diff -ruN postgresql-7.4.5-old/doc/src/sgml/ref/create_conversion.sgml postgresql-7.4.5/doc/src/sgml/ref/create_conversion.sgml --- postgresql-7.4.5-old/doc/src/sgml/ref/create_conversion.sgml 2003-09-22 02:16:57.000000000 +0200 +++ postgresql-7.4.5/doc/src/sgml/ref/create_conversion.sgml 2005-05-04 12:49:46.643170384 +0200 @@ -8,7 +8,7 @@ <refnamediv> <refname>CREATE CONVERSION</refname> - <refpurpose>define a new conversion</refpurpose> + <refpurpose>define a new encoding conversion</refpurpose> </refnamediv> <indexterm zone="sql-createconversion"> @@ -26,10 +26,12 @@ <title>Description</title> <para> - <command>CREATE CONVERSION</command> defines a new encoding - conversion. Conversion names may be used in the <function>convert</function> function + <command>CREATE CONVERSION</command> defines a new conversion between + character set encodings. Conversion names may be used in the + <function>convert</function> function to specify a particular encoding conversion. Also, conversions that - are marked <literal>DEFAULT</> can be used for automatic encoding conversion between + are marked <literal>DEFAULT</> can be used for automatic encoding + conversion between client and server. For this purpose, two conversions, from encoding A to B <emphasis>and</emphasis> from encoding B to A, must be defined. </para> @@ -109,7 +111,7 @@ integer, -- source encoding ID integer, -- destination encoding ID cstring, -- source string (null terminated C string) - cstring, -- destination string (null terminated C string) + internal, -- destination (fill with a null terminated C string) integer -- source string length ) RETURNS void; </programlisting> diff -ruN postgresql-7.4.5-old/src/backend/commands/conversioncmds.c postgresql-7.4.5/src/backend/commands/conversioncmds.c --- postgresql-7.4.5-old/src/backend/commands/conversioncmds.c 2003-08-04 04:39:58.000000000 +0200 +++ postgresql-7.4.5/src/backend/commands/conversioncmds.c 2005-05-04 12:49:46.654168712 +0200 @@ -46,7 +46,7 @@ const char *from_encoding_name = stmt->for_encoding_name; const char *to_encoding_name = stmt->to_encoding_name; List *func_name = stmt->func_name; - static Oid funcargs[] = {INT4OID, INT4OID, CSTRINGOID, CSTRINGOID, INT4OID}; + static Oid funcargs[] = {INT4OID, INT4OID, CSTRINGOID, INTERNALOID, INT4OID}; /* Convert list of names to a name and namespace */ namespaceId = QualifiedNameGetCreationNamespace(stmt->conversion_name, diff -ruN postgresql-7.4.5-old/src/backend/utils/mb/conversion_procs/Makefile postgresql-7.4.5/src/backend/utils/mb/conversion_procs/Makefile --- postgresql-7.4.5-old/src/backend/utils/mb/conversion_procs/Makefile 2004-01-21 20:25:11.000000000 +0100 +++ postgresql-7.4.5/src/backend/utils/mb/conversion_procs/Makefile 2005-05-04 12:49:46.671166128 +0200 @@ -157,7 +157,7 @@ func=$$1; shift; \ obj=$$1; shift; \ echo "-- $$se --> $$de"; \ - echo "CREATE OR REPLACE FUNCTION $$func (INTEGER, INTEGER, CSTRING, CSTRING, INTEGER) RETURNS VOID AS '$$"libdir"/$$obj', '$$func' LANGUAGE 'c' STRICT;"; \ + echo "CREATE OR REPLACE FUNCTION $$func (INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) RETURNS VOID AS '$$"libdir"/$$obj', '$$func' LANGUAGE 'c' STRICT;"; \ echo "DROP CONVERSION pg_catalog.$$name;"; \ echo "CREATE DEFAULT CONVERSION pg_catalog.$$name FOR '$$se' TO '$$de' FROM $$func;"; \ done > $@