]> granicus.if.org Git - postgresql/commitdiff
Alter the signature for encoding conversion functions to declare the
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 3 May 2005 19:18:48 +0000 (19:18 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 3 May 2005 19:18:48 +0000 (19:18 +0000)
output area as INTERNAL not CSTRING.  This is to prevent people from
calling the functions by hand.  This is a permanent solution for the
back branches but I hope it is just a stopgap for HEAD.

doc/src/sgml/ref/create_conversion.sgml
src/backend/commands/conversioncmds.c
src/backend/utils/mb/conversion_procs/Makefile

index bf8ec00ff7b8e9ee3e9a80fcf4af498c3767ff87..61b46136370720ca65ad9542cefb5074c662ecf4 100644 (file)
@@ -1,4 +1,4 @@
-<!-- $Header: /cvsroot/pgsql/doc/src/sgml/ref/create_conversion.sgml,v 1.5 2002/11/02 02:33:03 tgl Exp $ -->
+<!-- $Header: /cvsroot/pgsql/doc/src/sgml/ref/create_conversion.sgml,v 1.5.2.1 2005/05/03 19:18:48 tgl Exp $ -->
 
 <refentry id="SQL-CREATECONVERSION">
  <refmeta>
@@ -8,7 +8,7 @@
 
  <refnamediv>
   <refname>CREATE CONVERSION</refname>
-  <refpurpose>define a user-defined conversion</refpurpose>
+  <refpurpose>define a user-defined encoding conversion</refpurpose>
  </refnamediv>
 
  <refsynopsisdiv>
@@ -102,7 +102,7 @@ CREATE [DEFAULT] CONVERSION <replaceable>conversion_name</replaceable>
        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>
index 6115b0e12e59e6e17be5dfd7da853d8eebf2fd2f..69266d48f55bc50ce339dde6b21903b29288135f 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/commands/conversioncmds.c,v 1.5 2002/11/02 02:33:03 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/commands/conversioncmds.c,v 1.5.2.1 2005/05/03 19:18:48 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -41,7 +41,7 @@ CreateConversionCommand(CreateConversionStmt *stmt)
        const char *for_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,
index 6736a536c2eef6c4c6e8136bf44d25ca3082bf38..e60c8b1c5ce79829a9a37b3f5e2c62f97fb564cf 100644 (file)
@@ -4,7 +4,7 @@
 #    Makefile for utils/mb/conversion_procs
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/Makefile,v 1.7.2.1 2003/08/08 15:49:10 tgl Exp $
+#    $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/Makefile,v 1.7.2.2 2005/05/03 19:18:48 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -156,7 +156,7 @@ $(SQLSCRIPT): Makefile
                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 > $@