1CREATE CONVERSION(7)     PostgreSQL 11.6 Documentation    CREATE CONVERSION(7)
2
3
4

NAME

6       CREATE_CONVERSION - define a new encoding conversion
7

SYNOPSIS

9       CREATE [ DEFAULT ] CONVERSION name
10           FOR source_encoding TO dest_encoding FROM function_name
11

DESCRIPTION

13       CREATE CONVERSION defines a new conversion between character set
14       encodings. Also, conversions that are marked DEFAULT can be used for
15       automatic encoding conversion between client and server. For this
16       purpose, two conversions, from encoding A to B and from encoding B to
17       A, must be defined.
18
19       To be able to create a conversion, you must have EXECUTE privilege on
20       the function and CREATE privilege on the destination schema.
21

PARAMETERS

23       DEFAULT
24           The DEFAULT clause indicates that this conversion is the default
25           for this particular source to destination encoding. There should be
26           only one default encoding in a schema for the encoding pair.
27
28       name
29           The name of the conversion. The conversion name can be
30           schema-qualified. If it is not, the conversion is defined in the
31           current schema. The conversion name must be unique within a schema.
32
33       source_encoding
34           The source encoding name.
35
36       dest_encoding
37           The destination encoding name.
38
39       function_name
40           The function used to perform the conversion. The function name can
41           be schema-qualified. If it is not, the function will be looked up
42           in the path.
43
44           The function must have the following signature:
45
46               conv_proc(
47                   integer,  -- source encoding ID
48                   integer,  -- destination encoding ID
49                   cstring,  -- source string (null terminated C string)
50                   internal, -- destination (fill with a null terminated C string)
51                   integer   -- source string length
52               ) RETURNS void;
53

NOTES

55       Use DROP CONVERSION to remove user-defined conversions.
56
57       The privileges required to create a conversion might be changed in a
58       future release.
59

EXAMPLES

61       To create a conversion from encoding UTF8 to LATIN1 using myfunc:
62
63           CREATE CONVERSION myconv FOR 'UTF8' TO 'LATIN1' FROM myfunc;
64

COMPATIBILITY

66       CREATE CONVERSION is a PostgreSQL extension. There is no CREATE
67       CONVERSION statement in the SQL standard, but a CREATE TRANSLATION
68       statement that is very similar in purpose and syntax.
69

SEE ALSO

71       ALTER CONVERSION (ALTER_CONVERSION(7)), CREATE FUNCTION
72       (CREATE_FUNCTION(7)), DROP CONVERSION (DROP_CONVERSION(7))
73
74
75
76PostgreSQL 11.6                      2019                 CREATE CONVERSION(7)
Impressum