OSDN Git Service

Remove encoding lookups from grammar stage, push them back to places
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 2 Nov 2002 18:41:22 +0000 (18:41 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 2 Nov 2002 18:41:22 +0000 (18:41 +0000)
where it's safe to do database access.  Along the way, fix core dump
for 'DEFAULT' parameters to CREATE DATABASE.  initdb forced due to
change in pg_proc entry.

doc/src/sgml/keywords.sgml
src/backend/catalog/namespace.c
src/backend/catalog/pg_conversion.c
src/backend/commands/dbcommands.c
src/backend/parser/gram.y
src/backend/utils/mb/mbutils.c
src/include/catalog/catversion.h
src/include/catalog/namespace.h
src/include/catalog/pg_proc.h
src/include/utils/builtins.h
src/test/regress/expected/conversion.out

index 4c1a174..4986e30 100644 (file)
@@ -1,4 +1,4 @@
-<!-- $Header: /cvsroot/pgsql/doc/src/sgml/keywords.sgml,v 2.6 2002/06/20 16:00:43 momjian Exp $ -->
+<!-- $Header: /cvsroot/pgsql/doc/src/sgml/keywords.sgml,v 2.7 2002/11/02 18:41:21 tgl Exp $ -->
 
 <appendix id="sql-keywords-appendix">
  <title><acronym>SQL</acronym> Key Words</title>
    </row>
    <row>
     <entry><token>CONVERT</token></entry>
-    <entry></entry>
+    <entry>non-reserved (cannot be function or type)</entry>
     <entry>non-reserved</entry>
     <entry>reserved</entry>
    </row>
index bd2eaf5..4d9ff6c 100644 (file)
@@ -13,7 +13,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/catalog/namespace.c,v 1.37 2002/11/02 02:33:03 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/catalog/namespace.c,v 1.38 2002/11/02 18:41:21 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -1186,7 +1186,9 @@ makeRangeVarFromNameList(List *names)
 /*
  * NameListToString
  *             Utility routine to convert a qualified-name list into a string.
- *             Used primarily to form error messages.
+ *
+ * This is used primarily to form error messages, and so we do not quote
+ * the list elements, for the sake of legibility.
  */
 char *
 NameListToString(List *names)
@@ -1207,6 +1209,31 @@ NameListToString(List *names)
 }
 
 /*
+ * NameListToQuotedString
+ *             Utility routine to convert a qualified-name list into a string.
+ *
+ * Same as above except that names will be double-quoted where necessary,
+ * so the string could be re-parsed (eg, by textToQualifiedNameList).
+ */
+char *
+NameListToQuotedString(List *names)
+{
+       StringInfoData string;
+       List       *l;
+
+       initStringInfo(&string);
+
+       foreach(l, names)
+       {
+               if (l != names)
+                       appendStringInfoChar(&string, '.');
+               appendStringInfo(&string, "%s", quote_identifier(strVal(lfirst(l))));
+       }
+
+       return string.data;
+}
+
+/*
  * isTempNamespace - is the given namespace my temporary-table namespace?
  */
 bool
index c724d7e..7731a32 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/catalog/pg_conversion.c,v 1.7 2002/11/02 02:33:03 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/catalog/pg_conversion.c,v 1.8 2002/11/02 18:41:21 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -273,38 +273,44 @@ FindConversion(const char *conname, Oid connamespace)
  * CONVERT <left paren> <character value expression>
  * USING <form-of-use conversion name> <right paren>
  *
- * TEXT convert3(TEXT string, OID conversion_oid);
+ * TEXT convert_using(TEXT string, TEXT conversion_name)
  */
 Datum
-pg_convert3(PG_FUNCTION_ARGS)
+pg_convert_using(PG_FUNCTION_ARGS)
 {
        text       *string = PG_GETARG_TEXT_P(0);
-       Oid                     convoid = PG_GETARG_OID(1);
+       text       *conv_name = PG_GETARG_TEXT_P(1);
+       text       *retval;
+       List       *parsed_name;
+       Oid                     convoid;
        HeapTuple       tuple;
        Form_pg_conversion body;
-       text       *retval;
        unsigned char *str;
        unsigned char *result;
        int                     len;
 
-       if (!OidIsValid(convoid))
-               elog(ERROR, "Conversion does not exist");
-
-       /* make sure that source string is null terminated */
+       /* Convert input string to null-terminated form */
        len = VARSIZE(string) - VARHDRSZ;
        str = palloc(len + 1);
        memcpy(str, VARDATA(string), len);
        *(str + len) = '\0';
 
+       /* Look up the conversion name */
+       parsed_name = textToQualifiedNameList(conv_name, "convert_using");
+       convoid = FindConversionByName(parsed_name);
+       if (!OidIsValid(convoid))
+               elog(ERROR, "conversion %s not found", NameListToString(parsed_name));
+
        tuple = SearchSysCache(CONOID,
                                                   ObjectIdGetDatum(convoid),
                                                   0, 0, 0);
        if (!HeapTupleIsValid(tuple))
                elog(ERROR, "Conversion %u search from syscache failed", convoid);
+       body = (Form_pg_conversion) GETSTRUCT(tuple);
 
+       /* Temporary result area should be more than big enough */
        result = palloc(len * 4 + 1);
 
-       body = (Form_pg_conversion) GETSTRUCT(tuple);
        OidFunctionCall5(body->conproc,
                                         Int32GetDatum(body->conforencoding),
                                         Int32GetDatum(body->contoencoding),
@@ -315,7 +321,7 @@ pg_convert3(PG_FUNCTION_ARGS)
        ReleaseSysCache(tuple);
 
        /*
-        * build text data type structre. we cannot use textin() here, since
+        * build text result structure. we cannot use textin() here, since
         * textin assumes that input string encoding is same as database
         * encoding.
         */
@@ -327,8 +333,5 @@ pg_convert3(PG_FUNCTION_ARGS)
        pfree(result);
        pfree(str);
 
-       /* free memory if allocated by the toaster */
-       PG_FREE_IF_COPY(string, 0);
-
        PG_RETURN_TEXT_P(retval);
 }
index 327aac2..291770f 100644 (file)
@@ -9,7 +9,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.106 2002/10/21 22:06:19 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.107 2002/11/02 18:41:21 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -122,14 +122,34 @@ createdb(const CreatedbStmt *stmt)
                                 defel->defname);
        }
 
-       if (downer)
+       if (downer && downer->arg)
                dbowner = strVal(downer->arg);
-       if (dpath)
+       if (dpath && dpath->arg)
                dbpath = strVal(dpath->arg);
-       if (dtemplate)
+       if (dtemplate && dtemplate->arg)
                dbtemplate = strVal(dtemplate->arg);
-       if (dencoding)
-               encoding = intVal(dencoding->arg);
+       if (dencoding && dencoding->arg)
+       {
+               const char *encoding_name;
+
+               if (IsA(dencoding->arg, Integer))
+               {
+                       encoding = intVal(dencoding->arg);
+                       encoding_name = pg_encoding_to_char(encoding);
+                       if (strcmp(encoding_name, "") == 0 ||
+                               pg_valid_server_encoding(encoding_name) < 0)
+                               elog(ERROR, "%d is not a valid encoding code", encoding);
+               }
+               else if (IsA(dencoding->arg, String))
+               {
+                       encoding_name = strVal(dencoding->arg);
+                       if (pg_valid_server_encoding(encoding_name) < 0)
+                               elog(ERROR, "%s is not a valid encoding name", encoding_name);
+                       encoding = pg_char_to_encoding(encoding_name);
+               }
+               else
+                       elog(ERROR, "CREATE DATABASE: bogus encoding parameter");
+       }
 
        /* obtain sysid of proposed owner */
        if (dbowner)
index 32dd7b3..e1a179c 100644 (file)
@@ -11,7 +11,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.372 2002/11/01 22:52:33 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.373 2002/11/02 18:41:21 tgl Exp $
  *
  * HISTORY
  *       AUTHOR                        DATE                    MAJOR EVENT
@@ -53,7 +53,6 @@
 #include "access/htup.h"
 #include "catalog/index.h"
 #include "catalog/namespace.h"
-#include "catalog/pg_conversion.h"
 #include "catalog/pg_type.h"
 #include "nodes/makefuncs.h"
 #include "nodes/params.h"
@@ -63,7 +62,6 @@
 #include "utils/numeric.h"
 #include "utils/datetime.h"
 #include "utils/date.h"
-#include "mb/pg_wchar.h"
 
 extern List *parsetree;                        /* final parse result is delivered here */
 
@@ -217,8 +215,8 @@ static void doNegateFloat(Value *v);
                                group_clause TriggerFuncArgs select_limit
                                opt_select_limit opclass_item_list trans_options
                                TableFuncElementList
-                               convert_args prep_type_clause prep_type_list
-                               execute_param_clause execute_param_list
+                               prep_type_clause prep_type_list
+                               execute_param_clause
 
 %type <range>  into_clause OptTempTableName
 
@@ -234,7 +232,7 @@ static void doNegateFloat(Value *v);
 %type <jtype>  join_type
 
 %type <list>   extract_list overlay_list position_list
-%type <list>   substr_list trim_list convert_list
+%type <list>   substr_list trim_list
 %type <ival>   opt_interval
 %type <node>   overlay_placing substr_from substr_for
 
@@ -265,7 +263,7 @@ static void doNegateFloat(Value *v);
 %type <node>   def_arg columnElem where_clause insert_column_item
                                a_expr b_expr c_expr r_expr AexprConst
                                in_expr having_clause func_table
-%type <list>   row row_descriptor row_list in_expr_nodes type_list
+%type <list>   row row_descriptor type_list
 %type <node>   case_expr case_arg when_clause case_default
 %type <list>   when_clause_list
 %type <ival>   sub_type
@@ -325,8 +323,8 @@ static void doNegateFloat(Value *v);
        AGGREGATE ALL ALTER ANALYSE ANALYZE AND ANY AS ASC
        ASSERTION ASSIGNMENT AT AUTHORIZATION
 
-       BACKWARD BEFORE BEGIN_TRANS BETWEEN BIGINT BINARY BIT BOTH
-       BOOLEAN BY
+       BACKWARD BEFORE BEGIN_TRANS BETWEEN BIGINT BINARY BIT
+       BOOLEAN BOTH BY
 
        CACHE CALLED CASCADE CASE CAST CHAIN CHAR_P
        CHARACTER CHARACTERISTICS CHECK CHECKPOINT CLASS CLOSE
@@ -355,6 +353,7 @@ static void doNegateFloat(Value *v);
        INTERVAL INTO INVOKER IS ISNULL ISOLATION
 
        JOIN
+
        KEY
 
        LANCOMPILER LANGUAGE LEADING LEFT LEVEL LIKE LIMIT
@@ -371,8 +370,7 @@ static void doNegateFloat(Value *v);
        ORDER OUT_P OUTER_P OVERLAPS OVERLAY OWNER
 
        PARTIAL PASSWORD PATH_P PENDANT PLACING POSITION
-       PRECISION PREPARE PRIMARY PRIOR PRIVILEGES PROCEDURE
-       PROCEDURAL
+       PRECISION PREPARE PRIMARY PRIOR PRIVILEGES PROCEDURAL PROCEDURE
 
        READ REAL RECHECK REFERENCES REINDEX RELATIVE RENAME REPLACE
        RESET RESTRICT RETURNS REVOKE RIGHT ROLLBACK ROW
@@ -3618,27 +3616,15 @@ createdb_opt_item:
                                }
                        | ENCODING opt_equal Sconst
                                {
-                                       int             encoding;
-
-                                       if (pg_valid_server_encoding($3) < 0)
-                                               elog(ERROR, "%s is not a valid encoding name", $3);
-                                       encoding = pg_char_to_encoding($3);
-
-                                       $$ = makeDefElem("encoding", (Node *)makeInteger(encoding));
+                                       $$ = makeDefElem("encoding", (Node *)makeString($3));
                                }
                        | ENCODING opt_equal Iconst
                                {
-                                       const char *encoding_name;
-
-                                       encoding_name = pg_encoding_to_char($3);
-                                       if (!strcmp(encoding_name,"") ||
-                                           pg_valid_server_encoding(encoding_name) < 0)
-                                               elog(ERROR, "%d is not a valid encoding code", $3);
                                        $$ = makeDefElem("encoding", (Node *)makeInteger($3));
                                }
                        | ENCODING opt_equal DEFAULT
                                {
-                                       $$ = makeDefElem("encoding", (Node *)makeInteger(-1));
+                                       $$ = makeDefElem("encoding", NULL);
                                }
                        | OWNER opt_equal name
                                {
@@ -3932,14 +3918,10 @@ ExecuteStmt: EXECUTE name execute_param_clause into_clause
                                }
                ;
 
-execute_param_clause: '(' execute_param_list ')'       { $$ = $2; }
+execute_param_clause: '(' expr_list ')'                                { $$ = $2; }
                                        | /* EMPTY */                                   { $$ = NIL; }
                                        ;
 
-execute_param_list: a_expr                                                     { $$ = makeList1($1); }
-                                 | execute_param_list ',' a_expr       { $$ = lappend($1, $3); }
-                                 ;
-
 /*****************************************************************************
  *
  *             QUERY:
@@ -5470,14 +5452,9 @@ row:  ROW '(' row_descriptor ')'                                 { $$ = $3; }
                        | ROW '(' a_expr ')'                                    { $$ = makeList1($3); }
                        | ROW '(' ')'                                                   { $$ = NULL; }
                        | '(' row_descriptor ')'                                { $$ = $2; }
-;
-
-row_descriptor:
-                       row_list ',' a_expr                                             { $$ = lappend($1, $3); }
                ;
 
-row_list:      a_expr                                                                  { $$ = makeList1($1); }
-                       | row_list ',' a_expr                                   { $$ = lappend($1, $3); }
+row_descriptor:  expr_list ',' a_expr                          { $$ = lappend($1, $3); }
                ;
 
 sub_type:      ANY                                                                             { $$ = ANY_SUBLINK; }
@@ -6366,7 +6343,21 @@ c_expr:          columnref                                                               { $$ = (Node *) $1; }
                                        n->agg_distinct = FALSE;
                                        $$ = (Node *)n;
                                }
-                       | CONVERT '(' convert_list ')'
+                       | CONVERT '(' a_expr USING any_name ')'
+                               {
+                                       FuncCall *n = makeNode(FuncCall);
+                                       A_Const *c = makeNode(A_Const);
+
+                                       c->val.type = T_String;
+                                       c->val.val.str = NameListToQuotedString($5);
+
+                                       n->funcname = SystemFuncName("convert_using");
+                                       n->args = makeList2($3, c);
+                                       n->agg_star = FALSE;
+                                       n->agg_distinct = FALSE;
+                                       $$ = (Node *)n;
+                               }
+                       | CONVERT '(' expr_list ')'
                                {
                                        FuncCall *n = makeNode(FuncCall);
                                        n->funcname = SystemFuncName("convert");
@@ -6422,7 +6413,6 @@ opt_indirection:
 
 expr_list:     a_expr                                                                  { $$ = makeList1($1); }
                        | expr_list ',' a_expr                                  { $$ = lappend($1, $3); }
-                       | expr_list USING a_expr                                { $$ = lappend($1, $3); }
                ;
 
 extract_list:
@@ -6540,60 +6530,13 @@ trim_list:      a_expr FROM expr_list                                   { $$ = lappend($3, $1); }
                        | expr_list                                                             { $$ = $1; }
                ;
 
-/* CONVERT() arguments. We accept followings:
- * SQL99 syntax
- * o CONVERT(TEXT string USING conversion_name)
- *
- * Function calls
- * o CONVERT(TEXT string, NAME src_encoding_name, NAME dest_encoding_name)
- * o CONVERT(TEXT string, NAME encoding_name)
- */
-convert_list:
-                       a_expr USING any_name
-                               {
-                                       Oid oid = FindConversionByName($3);
-                                       Const *convoid = makeNode(Const);
-
-                                       if (!OidIsValid(oid))
-                                       {
-                                           elog(ERROR, "Conversion \"%s\" does not exist",
-                                                NameListToString($3));
-                                       }
-
-                                       convoid->consttype = OIDOID;
-                                       convoid->constlen = sizeof(Oid);
-                                       convoid->constvalue = oid;
-                                       convoid->constisnull = FALSE;
-                                       convoid->constbyval = TRUE;
-                                       convoid->constisset = FALSE;
-                                       convoid->constiscast = FALSE;
-                                       $$ = makeList2($1, convoid);
-                               }
-                       | convert_args
-                               {
-                                 $$ = $1;
-                               }
-                       | /*EMPTY*/
-                               { $$ = NIL; }
-               ;
-
-convert_args:  a_expr                                                          { $$ = makeList1($1); }
-                       | convert_args ',' a_expr                                       { $$ = lappend($1, $3); }
-               ;
-
-
 in_expr:       select_with_parens
                                {
                                        SubLink *n = makeNode(SubLink);
                                        n->subselect = $1;
                                        $$ = (Node *)n;
                                }
-                       | '(' in_expr_nodes ')'                                 { $$ = (Node *)$2; }
-               ;
-
-in_expr_nodes:
-                       a_expr                                                                  { $$ = makeList1($1); }
-                       | in_expr_nodes ',' a_expr                              { $$ = lappend($1, $3); }
+                       | '(' expr_list ')'                                             { $$ = (Node *)$2; }
                ;
 
 /* Case clause
@@ -7215,6 +7158,7 @@ col_name_keyword:
                        | CHAR_P
                        | CHARACTER
                        | COALESCE
+                       | CONVERT
                        | DEC
                        | DECIMAL
                        | EXISTS
index dfcad8e..6179fa9 100644 (file)
@@ -3,9 +3,11 @@
  * client encoding and server internal encoding.
  * (currently mule internal code (mic) is used)
  * Tatsuo Ishii
- * $Id: mbutils.c,v 1.35 2002/09/04 20:31:31 momjian Exp $
+ *
+ * $Header: /cvsroot/pgsql/src/backend/utils/mb/mbutils.c,v 1.36 2002/11/02 18:41:22 tgl Exp $
  */
 #include "postgres.h"
+
 #include "access/xact.h"
 #include "miscadmin.h"
 #include "mb/pg_wchar.h"
@@ -23,19 +25,18 @@ static pg_enc2name *ClientEncoding = &pg_enc2name_tbl[PG_SQL_ASCII];
 static pg_enc2name *DatabaseEncoding = &pg_enc2name_tbl[PG_SQL_ASCII];
 
 /*
- * Caches for conversion function info. Note that Fcinfo.flinfo is
- * allocated in TopMemoryContext so that it survives outside
+ * Caches for conversion function info. Note that these values are
+ * allocated in TopMemoryContext so that they survive across
  * transactions. See SetClientEncoding() for more details.
  */
-static FmgrInfo *ToServerConvPorc = NULL;
-static FmgrInfo *ToClientConvPorc = NULL;
+static FmgrInfo *ToServerConvProc = NULL;
+static FmgrInfo *ToClientConvProc = NULL;
 
 /* Internal functions */
-static unsigned char *
-                       perform_default_encoding_conversion(unsigned char *src, int len, bool is_client_to_server);
+static unsigned char *perform_default_encoding_conversion(unsigned char *src,
+                                                                       int len, bool is_client_to_server);
+static int cliplen(const unsigned char *str, int len, int limit);
 
-static int
-                       cliplen(const unsigned char *str, int len, int limit);
 
 /*
  * Set the client encoding and save fmgrinfo for the converion
@@ -95,21 +96,21 @@ SetClientEncoding(int encoding, bool doit)
        {
                ClientEncoding = &pg_enc2name_tbl[encoding];
 
-               if (ToServerConvPorc != NULL)
+               if (ToServerConvProc != NULL)
                {
-                       if (ToServerConvPorc->fn_extra)
-                               pfree(ToServerConvPorc->fn_extra);
-                       pfree(ToServerConvPorc);
+                       if (ToServerConvProc->fn_extra)
+                               pfree(ToServerConvProc->fn_extra);
+                       pfree(ToServerConvProc);
                }
-               ToServerConvPorc = to_server;
+               ToServerConvProc = to_server;
 
-               if (ToClientConvPorc != NULL)
+               if (ToClientConvProc != NULL)
                {
-                       if (ToClientConvPorc->fn_extra)
-                               pfree(ToClientConvPorc->fn_extra);
-                       pfree(ToClientConvPorc);
+                       if (ToClientConvProc->fn_extra)
+                               pfree(ToClientConvProc->fn_extra);
+                       pfree(ToClientConvProc);
                }
-               ToClientConvPorc = to_client;
+               ToClientConvProc = to_client;
        }
        return 0;
 }
@@ -323,13 +324,13 @@ perform_default_encoding_conversion(unsigned char *src, int len, bool is_client_
        {
                src_encoding = ClientEncoding->encoding;
                dest_encoding = DatabaseEncoding->encoding;
-               flinfo = ToServerConvPorc;
+               flinfo = ToServerConvProc;
        }
        else
        {
                src_encoding = DatabaseEncoding->encoding;
                dest_encoding = ClientEncoding->encoding;
-               flinfo = ToClientConvPorc;
+               flinfo = ToClientConvProc;
        }
 
        if (flinfo == NULL)
index 58df9af..9c00121 100644 (file)
@@ -37,7 +37,7 @@
  * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $Id: catversion.h,v 1.162 2002/10/19 02:08:18 momjian Exp $
+ * $Id: catversion.h,v 1.163 2002/11/02 18:41:22 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -53,6 +53,6 @@
  */
 
 /*                                                     yyyymmddN */
-#define CATALOG_VERSION_NO     200210181
+#define CATALOG_VERSION_NO     200211021
 
 #endif
index 531afac..793a84b 100644 (file)
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $Id: namespace.h,v 1.21 2002/09/23 20:43:41 tgl Exp $
+ * $Id: namespace.h,v 1.22 2002/11/02 18:41:22 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -74,6 +74,7 @@ extern Oid    LookupExplicitNamespace(const char *nspname);
 extern Oid     QualifiedNameGetCreationNamespace(List *names, char **objname_p);
 extern RangeVar *makeRangeVarFromNameList(List *names);
 extern char *NameListToString(List *names);
+extern char *NameListToQuotedString(List *names);
 
 extern bool isTempNamespace(Oid namespaceId);
 extern bool isOtherTempNamespace(Oid namespaceId);
index 9519781..9b8dc08 100644 (file)
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $Id: pg_proc.h,v 1.274 2002/10/19 02:08:18 momjian Exp $
+ * $Id: pg_proc.h,v 1.275 2002/11/02 18:41:22 tgl Exp $
  *
  * NOTES
  *       The script catalog/genbki.sh reads this file and generates .bki
@@ -2166,8 +2166,8 @@ DESCR("convert string with specified destination encoding name");
 DATA(insert OID = 1813 (  convert                 PGNSP PGUID 12 f f t f s 3 25 "25 19 19"  pg_convert2 - _null_ ));
 DESCR("convert string with specified encoding names");
 
-DATA(insert OID = 90 ( convert            PGNSP PGUID 12 f f t f s 2 25 "25 26"  pg_convert3 - _null_ ));
-DESCR("convert string with specified conversion oid");
+DATA(insert OID = 1619 (  convert_using           PGNSP PGUID 12 f f t f s 2 25 "25 25"  pg_convert_using - _null_ ));
+DESCR("convert string with specified conversion name");
 
 DATA(insert OID = 1264 (  pg_char_to_encoding     PGNSP PGUID 12 f f t f s 1 23 "19"  PG_char_to_encoding - _null_ ));
 DESCR("convert encoding name to encoding id");
index 990c9f3..a933520 100644 (file)
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $Id: builtins.h,v 1.203 2002/10/19 02:08:18 momjian Exp $
+ * $Id: builtins.h,v 1.204 2002/11/02 18:41:22 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -696,6 +696,6 @@ extern Datum show_all_settings(PG_FUNCTION_ARGS);
 extern Datum pg_lock_status(PG_FUNCTION_ARGS);
 
 /* catalog/pg_conversion.c */
-extern Datum pg_convert3(PG_FUNCTION_ARGS);
+extern Datum pg_convert_using(PG_FUNCTION_ARGS);
 
 #endif   /* BUILTINS_H */
index 8dcd79a..5ec1adf 100644 (file)
@@ -27,8 +27,8 @@ DROP CONVERSION mydef;
 -- make sure all pre-defined conversions are fine.
 -- SQL_ASCII --> MULE_INTERNAL
 SELECT CONVERT('foo' USING ascii_to_mic);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -40,8 +40,8 @@ SELECT CONVERT('foo', 'SQL_ASCII', 'MULE_INTERNAL');
 
 -- MULE_INTERNAL --> SQL_ASCII
 SELECT CONVERT('foo' USING mic_to_ascii);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -53,8 +53,8 @@ SELECT CONVERT('foo', 'MULE_INTERNAL', 'SQL_ASCII');
 
 -- KOI8R --> MULE_INTERNAL
 SELECT CONVERT('foo' USING koi8_r_to_mic);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -66,8 +66,8 @@ SELECT CONVERT('foo', 'KOI8R', 'MULE_INTERNAL');
 
 -- MULE_INTERNAL --> KOI8R
 SELECT CONVERT('foo' USING mic_to_koi8_r);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -79,8 +79,8 @@ SELECT CONVERT('foo', 'MULE_INTERNAL', 'KOI8R');
 
 -- ISO-8859-5 --> MULE_INTERNAL
 SELECT CONVERT('foo' USING iso_8859_5_to_mic);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -92,8 +92,8 @@ SELECT CONVERT('foo', 'ISO-8859-5', 'MULE_INTERNAL');
 
 -- MULE_INTERNAL --> ISO-8859-5
 SELECT CONVERT('foo' USING mic_to_iso_8859_5);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -105,8 +105,8 @@ SELECT CONVERT('foo', 'MULE_INTERNAL', 'ISO-8859-5');
 
 -- WIN1251 --> MULE_INTERNAL
 SELECT CONVERT('foo' USING windows_1251_to_mic);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -118,8 +118,8 @@ SELECT CONVERT('foo', 'WIN1251', 'MULE_INTERNAL');
 
 -- MULE_INTERNAL --> WIN1251
 SELECT CONVERT('foo' USING mic_to_windows_1251);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -131,8 +131,8 @@ SELECT CONVERT('foo', 'MULE_INTERNAL', 'WIN1251');
 
 -- ALT --> MULE_INTERNAL
 SELECT CONVERT('foo' USING windows_866_to_mic);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -144,8 +144,8 @@ SELECT CONVERT('foo', 'ALT', 'MULE_INTERNAL');
 
 -- MULE_INTERNAL --> ALT
 SELECT CONVERT('foo' USING mic_to_windows_866);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -157,8 +157,8 @@ SELECT CONVERT('foo', 'MULE_INTERNAL', 'ALT');
 
 -- KOI8R --> WIN1251
 SELECT CONVERT('foo' USING koi8_r_to_windows_1251);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -170,8 +170,8 @@ SELECT CONVERT('foo', 'KOI8R', 'WIN1251');
 
 -- WIN1251 --> KOI8R
 SELECT CONVERT('foo' USING windows_1251_to_koi8_r);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -183,8 +183,8 @@ SELECT CONVERT('foo', 'WIN1251', 'KOI8R');
 
 -- KOI8R --> ALT
 SELECT CONVERT('foo' USING koi8_r_to_windows_866);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -196,8 +196,8 @@ SELECT CONVERT('foo', 'KOI8R', 'ALT');
 
 -- ALT --> KOI8R
 SELECT CONVERT('foo' USING windows_866_to_koi8_r);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -209,8 +209,8 @@ SELECT CONVERT('foo', 'ALT', 'KOI8R');
 
 -- ALT --> WIN1251
 SELECT CONVERT('foo' USING windows_866_to_windows_1251);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -222,8 +222,8 @@ SELECT CONVERT('foo', 'ALT', 'WIN1251');
 
 -- WIN1251 --> ALT
 SELECT CONVERT('foo' USING windows_1251_to_windows_866);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -235,8 +235,8 @@ SELECT CONVERT('foo', 'WIN1251', 'ALT');
 
 -- ISO-8859-5 --> KOI8R
 SELECT CONVERT('foo' USING iso_8859_5_to_koi8_r);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -248,8 +248,8 @@ SELECT CONVERT('foo', 'ISO-8859-5', 'KOI8R');
 
 -- KOI8R --> ISO-8859-5
 SELECT CONVERT('foo' USING koi8_r_to_iso_8859_5);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -261,8 +261,8 @@ SELECT CONVERT('foo', 'KOI8R', 'ISO-8859-5');
 
 -- ISO-8859-5 --> WIN1251
 SELECT CONVERT('foo' USING iso_8859_5_to_windows_1251);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -274,8 +274,8 @@ SELECT CONVERT('foo', 'ISO-8859-5', 'WIN1251');
 
 -- WIN1251 --> ISO-8859-5
 SELECT CONVERT('foo' USING windows_1251_to_iso_8859_5);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -287,8 +287,8 @@ SELECT CONVERT('foo', 'WIN1251', 'ISO-8859-5');
 
 -- ISO-8859-5 --> ALT
 SELECT CONVERT('foo' USING iso_8859_5_to_windows_866);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -300,8 +300,8 @@ SELECT CONVERT('foo', 'ISO-8859-5', 'ALT');
 
 -- ALT --> ISO-8859-5
 SELECT CONVERT('foo' USING windows_866_to_iso_8859_5);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -313,8 +313,8 @@ SELECT CONVERT('foo', 'ALT', 'ISO-8859-5');
 
 -- EUC_CN --> MULE_INTERNAL
 SELECT CONVERT('foo' USING euc_cn_to_mic);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -326,8 +326,8 @@ SELECT CONVERT('foo', 'EUC_CN', 'MULE_INTERNAL');
 
 -- MULE_INTERNAL --> EUC_CN
 SELECT CONVERT('foo' USING mic_to_euc_cn);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -339,8 +339,8 @@ SELECT CONVERT('foo', 'MULE_INTERNAL', 'EUC_CN');
 
 -- EUC_JP --> SJIS
 SELECT CONVERT('foo' USING euc_jp_to_sjis);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -352,8 +352,8 @@ SELECT CONVERT('foo', 'EUC_JP', 'SJIS');
 
 -- SJIS --> EUC_JP
 SELECT CONVERT('foo' USING sjis_to_euc_jp);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -365,8 +365,8 @@ SELECT CONVERT('foo', 'SJIS', 'EUC_JP');
 
 -- EUC_JP --> MULE_INTERNAL
 SELECT CONVERT('foo' USING euc_jp_to_mic);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -378,8 +378,8 @@ SELECT CONVERT('foo', 'EUC_JP', 'MULE_INTERNAL');
 
 -- SJIS --> MULE_INTERNAL
 SELECT CONVERT('foo' USING sjis_to_mic);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -391,8 +391,8 @@ SELECT CONVERT('foo', 'SJIS', 'MULE_INTERNAL');
 
 -- MULE_INTERNAL --> EUC_JP
 SELECT CONVERT('foo' USING mic_to_euc_jp);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -404,8 +404,8 @@ SELECT CONVERT('foo', 'MULE_INTERNAL', 'EUC_JP');
 
 -- MULE_INTERNAL --> SJIS
 SELECT CONVERT('foo' USING mic_to_sjis);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -417,8 +417,8 @@ SELECT CONVERT('foo', 'MULE_INTERNAL', 'SJIS');
 
 -- EUC_KR --> MULE_INTERNAL
 SELECT CONVERT('foo' USING euc_kr_to_mic);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -430,8 +430,8 @@ SELECT CONVERT('foo', 'EUC_KR', 'MULE_INTERNAL');
 
 -- MULE_INTERNAL --> EUC_KR
 SELECT CONVERT('foo' USING mic_to_euc_kr);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -443,8 +443,8 @@ SELECT CONVERT('foo', 'MULE_INTERNAL', 'EUC_KR');
 
 -- EUC_TW --> BIG5
 SELECT CONVERT('foo' USING euc_tw_to_big5);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -456,8 +456,8 @@ SELECT CONVERT('foo', 'EUC_TW', 'BIG5');
 
 -- BIG5 --> EUC_TW
 SELECT CONVERT('foo' USING big5_to_euc_tw);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -469,8 +469,8 @@ SELECT CONVERT('foo', 'BIG5', 'EUC_TW');
 
 -- EUC_TW --> MULE_INTERNAL
 SELECT CONVERT('foo' USING euc_tw_to_mic);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -482,8 +482,8 @@ SELECT CONVERT('foo', 'EUC_TW', 'MULE_INTERNAL');
 
 -- BIG5 --> MULE_INTERNAL
 SELECT CONVERT('foo' USING big5_to_mic);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -495,8 +495,8 @@ SELECT CONVERT('foo', 'BIG5', 'MULE_INTERNAL');
 
 -- MULE_INTERNAL --> EUC_TW
 SELECT CONVERT('foo' USING mic_to_euc_tw);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -508,8 +508,8 @@ SELECT CONVERT('foo', 'MULE_INTERNAL', 'EUC_TW');
 
 -- MULE_INTERNAL --> BIG5
 SELECT CONVERT('foo' USING mic_to_big5);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -521,8 +521,8 @@ SELECT CONVERT('foo', 'MULE_INTERNAL', 'BIG5');
 
 -- LATIN2 --> MULE_INTERNAL
 SELECT CONVERT('foo' USING iso_8859_2_to_mic);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -534,8 +534,8 @@ SELECT CONVERT('foo', 'LATIN2', 'MULE_INTERNAL');
 
 -- MULE_INTERNAL --> LATIN2
 SELECT CONVERT('foo' USING mic_to_iso_8859_2);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -547,8 +547,8 @@ SELECT CONVERT('foo', 'MULE_INTERNAL', 'LATIN2');
 
 -- WIN1250 --> MULE_INTERNAL
 SELECT CONVERT('foo' USING windows_1250_to_mic);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -560,8 +560,8 @@ SELECT CONVERT('foo', 'WIN1250', 'MULE_INTERNAL');
 
 -- MULE_INTERNAL --> WIN1250
 SELECT CONVERT('foo' USING mic_to_windows_1250);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -573,8 +573,8 @@ SELECT CONVERT('foo', 'MULE_INTERNAL', 'WIN1250');
 
 -- LATIN2 --> WIN1250
 SELECT CONVERT('foo' USING iso_8859_2_to_windows_1250);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -586,8 +586,8 @@ SELECT CONVERT('foo', 'LATIN2', 'WIN1250');
 
 -- WIN1250 --> LATIN2
 SELECT CONVERT('foo' USING windows_1250_to_iso_8859_2);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -599,8 +599,8 @@ SELECT CONVERT('foo', 'WIN1250', 'LATIN2');
 
 -- LATIN1 --> MULE_INTERNAL
 SELECT CONVERT('foo' USING iso_8859_1_to_mic);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -612,8 +612,8 @@ SELECT CONVERT('foo', 'LATIN1', 'MULE_INTERNAL');
 
 -- MULE_INTERNAL --> LATIN1
 SELECT CONVERT('foo' USING mic_to_iso_8859_1);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -625,8 +625,8 @@ SELECT CONVERT('foo', 'MULE_INTERNAL', 'LATIN1');
 
 -- LATIN3 --> MULE_INTERNAL
 SELECT CONVERT('foo' USING iso_8859_3_to_mic);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -638,8 +638,8 @@ SELECT CONVERT('foo', 'LATIN3', 'MULE_INTERNAL');
 
 -- MULE_INTERNAL --> LATIN3
 SELECT CONVERT('foo' USING mic_to_iso_8859_3);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -651,8 +651,8 @@ SELECT CONVERT('foo', 'MULE_INTERNAL', 'LATIN3');
 
 -- LATIN4 --> MULE_INTERNAL
 SELECT CONVERT('foo' USING iso_8859_4_to_mic);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -664,8 +664,8 @@ SELECT CONVERT('foo', 'LATIN4', 'MULE_INTERNAL');
 
 -- MULE_INTERNAL --> LATIN4
 SELECT CONVERT('foo' USING mic_to_iso_8859_4);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -677,8 +677,8 @@ SELECT CONVERT('foo', 'MULE_INTERNAL', 'LATIN4');
 
 -- SQL_ASCII --> UNICODE
 SELECT CONVERT('foo' USING ascii_to_utf_8);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -690,8 +690,8 @@ SELECT CONVERT('foo', 'SQL_ASCII', 'UNICODE');
 
 -- UNICODE --> SQL_ASCII
 SELECT CONVERT('foo' USING utf_8_to_ascii);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -703,8 +703,8 @@ SELECT CONVERT('foo', 'UNICODE', 'SQL_ASCII');
 
 -- BIG5 --> UNICODE
 SELECT CONVERT('foo' USING big5_to_utf_8);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -716,8 +716,8 @@ SELECT CONVERT('foo', 'BIG5', 'UNICODE');
 
 -- UNICODE --> BIG5
 SELECT CONVERT('foo' USING utf_8_to_big5);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -729,8 +729,8 @@ SELECT CONVERT('foo', 'UNICODE', 'BIG5');
 
 -- UNICODE --> KOI8R
 SELECT CONVERT('foo' USING utf_8_to_koi8_r);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -742,8 +742,8 @@ SELECT CONVERT('foo', 'UNICODE', 'KOI8R');
 
 -- KOI8R --> UNICODE
 SELECT CONVERT('foo' USING koi8_r_to_utf_8);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -755,8 +755,8 @@ SELECT CONVERT('foo', 'KOI8R', 'UNICODE');
 
 -- UNICODE --> WIN1251
 SELECT CONVERT('foo' USING utf_8_to_windows_1251);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -768,8 +768,8 @@ SELECT CONVERT('foo', 'UNICODE', 'WIN1251');
 
 -- WIN1251 --> UNICODE
 SELECT CONVERT('foo' USING windows_1251_to_utf_8);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -781,8 +781,8 @@ SELECT CONVERT('foo', 'WIN1251', 'UNICODE');
 
 -- UNICODE --> ALT
 SELECT CONVERT('foo' USING utf_8_to_windows_866);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -794,8 +794,8 @@ SELECT CONVERT('foo', 'UNICODE', 'ALT');
 
 -- ALT --> UNICODE
 SELECT CONVERT('foo' USING windows_866_to_utf_8);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -807,8 +807,8 @@ SELECT CONVERT('foo', 'ALT', 'UNICODE');
 
 -- EUC_CN --> UNICODE
 SELECT CONVERT('foo' USING euc_cn_to_utf_8);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -820,8 +820,8 @@ SELECT CONVERT('foo', 'EUC_CN', 'UNICODE');
 
 -- UNICODE --> EUC_CN
 SELECT CONVERT('foo' USING utf_8_to_euc_cn);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -833,8 +833,8 @@ SELECT CONVERT('foo', 'UNICODE', 'EUC_CN');
 
 -- EUC_JP --> UNICODE
 SELECT CONVERT('foo' USING euc_jp_to_utf_8);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -846,8 +846,8 @@ SELECT CONVERT('foo', 'EUC_JP', 'UNICODE');
 
 -- UNICODE --> EUC_JP
 SELECT CONVERT('foo' USING utf_8_to_euc_jp);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -859,8 +859,8 @@ SELECT CONVERT('foo', 'UNICODE', 'EUC_JP');
 
 -- EUC_KR --> UNICODE
 SELECT CONVERT('foo' USING euc_kr_to_utf_8);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -872,8 +872,8 @@ SELECT CONVERT('foo', 'EUC_KR', 'UNICODE');
 
 -- UNICODE --> EUC_KR
 SELECT CONVERT('foo' USING utf_8_to_euc_kr);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -885,8 +885,8 @@ SELECT CONVERT('foo', 'UNICODE', 'EUC_KR');
 
 -- EUC_TW --> UNICODE
 SELECT CONVERT('foo' USING euc_tw_to_utf_8);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -898,8 +898,8 @@ SELECT CONVERT('foo', 'EUC_TW', 'UNICODE');
 
 -- UNICODE --> EUC_TW
 SELECT CONVERT('foo' USING utf_8_to_euc_tw);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -911,8 +911,8 @@ SELECT CONVERT('foo', 'UNICODE', 'EUC_TW');
 
 -- GB18030 --> UNICODE
 SELECT CONVERT('foo' USING gb18030_to_utf_8);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -924,8 +924,8 @@ SELECT CONVERT('foo', 'GB18030', 'UNICODE');
 
 -- UNICODE --> GB18030
 SELECT CONVERT('foo' USING utf_8_to_gb18030);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -937,8 +937,8 @@ SELECT CONVERT('foo', 'UNICODE', 'GB18030');
 
 -- GBK --> UNICODE
 SELECT CONVERT('foo' USING gbk_to_utf_8);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -950,8 +950,8 @@ SELECT CONVERT('foo', 'GBK', 'UNICODE');
 
 -- UNICODE --> GBK
 SELECT CONVERT('foo' USING utf_8_to_gbk);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -963,8 +963,8 @@ SELECT CONVERT('foo', 'UNICODE', 'GBK');
 
 -- UNICODE --> LATIN2
 SELECT CONVERT('foo' USING utf_8_to_iso_8859_2);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -976,8 +976,8 @@ SELECT CONVERT('foo', 'UNICODE', 'LATIN2');
 
 -- LATIN2 --> UNICODE
 SELECT CONVERT('foo' USING iso_8859_2_to_utf_8);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -989,8 +989,8 @@ SELECT CONVERT('foo', 'LATIN2', 'UNICODE');
 
 -- UNICODE --> LATIN3
 SELECT CONVERT('foo' USING utf_8_to_iso_8859_3);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1002,8 +1002,8 @@ SELECT CONVERT('foo', 'UNICODE', 'LATIN3');
 
 -- LATIN3 --> UNICODE
 SELECT CONVERT('foo' USING iso_8859_3_to_utf_8);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1015,8 +1015,8 @@ SELECT CONVERT('foo', 'LATIN3', 'UNICODE');
 
 -- UNICODE --> LATIN4
 SELECT CONVERT('foo' USING utf_8_to_iso_8859_4);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1028,8 +1028,8 @@ SELECT CONVERT('foo', 'UNICODE', 'LATIN4');
 
 -- LATIN4 --> UNICODE
 SELECT CONVERT('foo' USING iso_8859_4_to_utf_8);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1041,8 +1041,8 @@ SELECT CONVERT('foo', 'LATIN4', 'UNICODE');
 
 -- UNICODE --> LATIN5
 SELECT CONVERT('foo' USING utf_8_to_iso_8859_9);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1054,8 +1054,8 @@ SELECT CONVERT('foo', 'UNICODE', 'LATIN5');
 
 -- LATIN5 --> UNICODE
 SELECT CONVERT('foo' USING iso_8859_9_to_utf_8);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1067,8 +1067,8 @@ SELECT CONVERT('foo', 'LATIN5', 'UNICODE');
 
 -- UNICODE --> LATIN6
 SELECT CONVERT('foo' USING utf_8_to_iso_8859_10);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1080,8 +1080,8 @@ SELECT CONVERT('foo', 'UNICODE', 'LATIN6');
 
 -- LATIN6 --> UNICODE
 SELECT CONVERT('foo' USING iso_8859_10_to_utf_8);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1093,8 +1093,8 @@ SELECT CONVERT('foo', 'LATIN6', 'UNICODE');
 
 -- UNICODE --> LATIN7
 SELECT CONVERT('foo' USING utf_8_to_iso_8859_13);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1106,8 +1106,8 @@ SELECT CONVERT('foo', 'UNICODE', 'LATIN7');
 
 -- LATIN7 --> UNICODE
 SELECT CONVERT('foo' USING iso_8859_13_to_utf_8);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1119,8 +1119,8 @@ SELECT CONVERT('foo', 'LATIN7', 'UNICODE');
 
 -- UNICODE --> LATIN8
 SELECT CONVERT('foo' USING utf_8_to_iso_8859_14);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1132,8 +1132,8 @@ SELECT CONVERT('foo', 'UNICODE', 'LATIN8');
 
 -- LATIN8 --> UNICODE
 SELECT CONVERT('foo' USING iso_8859_14_to_utf_8);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1145,8 +1145,8 @@ SELECT CONVERT('foo', 'LATIN8', 'UNICODE');
 
 -- UNICODE --> LATIN9
 SELECT CONVERT('foo' USING utf_8_to_iso_8859_15);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1158,8 +1158,8 @@ SELECT CONVERT('foo', 'UNICODE', 'LATIN9');
 
 -- LATIN9 --> UNICODE
 SELECT CONVERT('foo' USING iso_8859_15_to_utf_8);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1171,8 +1171,8 @@ SELECT CONVERT('foo', 'LATIN9', 'UNICODE');
 
 -- UNICODE --> LATIN10
 SELECT CONVERT('foo' USING utf_8_to_iso_8859_16);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1184,8 +1184,8 @@ SELECT CONVERT('foo', 'UNICODE', 'LATIN10');
 
 -- LATIN10 --> UNICODE
 SELECT CONVERT('foo' USING iso_8859_16_to_utf_8);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1197,8 +1197,8 @@ SELECT CONVERT('foo', 'LATIN10', 'UNICODE');
 
 -- UNICODE --> ISO-8859-5
 SELECT CONVERT('foo' USING utf_8_to_iso_8859_5);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1210,8 +1210,8 @@ SELECT CONVERT('foo', 'UNICODE', 'ISO-8859-5');
 
 -- ISO-8859-5 --> UNICODE
 SELECT CONVERT('foo' USING iso_8859_5_to_utf_8);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1223,8 +1223,8 @@ SELECT CONVERT('foo', 'ISO-8859-5', 'UNICODE');
 
 -- UNICODE --> ISO-8859-6
 SELECT CONVERT('foo' USING utf_8_to_iso_8859_6);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1236,8 +1236,8 @@ SELECT CONVERT('foo', 'UNICODE', 'ISO-8859-6');
 
 -- ISO-8859-6 --> UNICODE
 SELECT CONVERT('foo' USING iso_8859_6_to_utf_8);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1249,8 +1249,8 @@ SELECT CONVERT('foo', 'ISO-8859-6', 'UNICODE');
 
 -- UNICODE --> ISO-8859-7
 SELECT CONVERT('foo' USING utf_8_to_iso_8859_7);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1262,8 +1262,8 @@ SELECT CONVERT('foo', 'UNICODE', 'ISO-8859-7');
 
 -- ISO-8859-7 --> UNICODE
 SELECT CONVERT('foo' USING iso_8859_7_to_utf_8);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1275,8 +1275,8 @@ SELECT CONVERT('foo', 'ISO-8859-7', 'UNICODE');
 
 -- UNICODE --> ISO-8859-8
 SELECT CONVERT('foo' USING utf_8_to_iso_8859_8);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1288,8 +1288,8 @@ SELECT CONVERT('foo', 'UNICODE', 'ISO-8859-8');
 
 -- ISO-8859-8 --> UNICODE
 SELECT CONVERT('foo' USING iso_8859_8_to_utf_8);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1301,8 +1301,8 @@ SELECT CONVERT('foo', 'ISO-8859-8', 'UNICODE');
 
 -- LATIN1 --> UNICODE
 SELECT CONVERT('foo' USING iso_8859_1_to_utf_8);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1314,8 +1314,8 @@ SELECT CONVERT('foo', 'LATIN1', 'UNICODE');
 
 -- UNICODE --> LATIN1
 SELECT CONVERT('foo' USING utf_8_to_iso_8859_1);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1327,8 +1327,8 @@ SELECT CONVERT('foo', 'UNICODE', 'LATIN1');
 
 -- JOHAB --> UNICODE
 SELECT CONVERT('foo' USING johab_to_utf_8);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1340,8 +1340,8 @@ SELECT CONVERT('foo', 'JOHAB', 'UNICODE');
 
 -- UNICODE --> JOHAB
 SELECT CONVERT('foo' USING utf_8_to_johab);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1353,8 +1353,8 @@ SELECT CONVERT('foo', 'UNICODE', 'JOHAB');
 
 -- SJIS --> UNICODE
 SELECT CONVERT('foo' USING sjis_to_utf_8);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1366,8 +1366,8 @@ SELECT CONVERT('foo', 'SJIS', 'UNICODE');
 
 -- UNICODE --> SJIS
 SELECT CONVERT('foo' USING utf_8_to_sjis);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1379,8 +1379,8 @@ SELECT CONVERT('foo', 'UNICODE', 'SJIS');
 
 -- TCVN --> UNICODE
 SELECT CONVERT('foo' USING tcvn_to_utf_8);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1392,8 +1392,8 @@ SELECT CONVERT('foo', 'TCVN', 'UNICODE');
 
 -- UNICODE --> TCVN
 SELECT CONVERT('foo' USING utf_8_to_tcvn);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1405,8 +1405,8 @@ SELECT CONVERT('foo', 'UNICODE', 'TCVN');
 
 -- UHC --> UNICODE
 SELECT CONVERT('foo' USING uhc_to_utf_8);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1418,8 +1418,8 @@ SELECT CONVERT('foo', 'UHC', 'UNICODE');
 
 -- UNICODE --> UHC
 SELECT CONVERT('foo' USING utf_8_to_uhc);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1431,8 +1431,8 @@ SELECT CONVERT('foo', 'UNICODE', 'UHC');
 
 -- UNICODE --> WIN1250
 SELECT CONVERT('foo' USING utf_8_to_windows_1250);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1444,8 +1444,8 @@ SELECT CONVERT('foo', 'UNICODE', 'WIN1250');
 
 -- WIN1250 --> UNICODE
 SELECT CONVERT('foo' USING windows_1250_to_utf_8);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1457,8 +1457,8 @@ SELECT CONVERT('foo', 'WIN1250', 'UNICODE');
 
 -- UNICODE --> WIN1256
 SELECT CONVERT('foo' USING utf_8_to_windows_1256);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1470,8 +1470,8 @@ SELECT CONVERT('foo', 'UNICODE', 'WIN1256');
 
 -- WIN1256 --> UNICODE
 SELECT CONVERT('foo' USING windows_1256_to_utf_8);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1483,8 +1483,8 @@ SELECT CONVERT('foo', 'WIN1256', 'UNICODE');
 
 -- UNICODE --> WIN874
 SELECT CONVERT('foo' USING utf_8_to_windows_874);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)
 
@@ -1496,8 +1496,8 @@ SELECT CONVERT('foo', 'UNICODE', 'WIN874');
 
 -- WIN874 --> UNICODE
 SELECT CONVERT('foo' USING windows_874_to_utf_8);
- convert 
----------
+ convert_using 
+---------------
  foo
 (1 row)