Alter the signature for encoding conversion functions to declare the
authorTom Lane
Tue, 3 May 2005 19:17:59 +0000 (19:17 +0000)
committerTom Lane
Tue, 3 May 2005 19:17:59 +0000 (19:17 +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 3b941b80bb11e671ef193f375d3e1c16acefecb7..9bf88807c142bb5209890c928b7445aa3de5a619 100644 (file)
@@ -1,4 +1,4 @@
-
+
 
 
  
@@ -8,7 +8,7 @@
 
  
   CREATE CONVERSION
-  define a new conversion
+  define a new encoding conversion
  
 
  
@@ -26,10 +26,12 @@ CREATE [DEFAULT] CONVERSION name
   Description
 
   
-   CREATE CONVERSION defines a new encoding
-   conversion.  Conversion names may be used in the convert function
+   CREATE CONVERSION defines a new conversion between
+   character set encodings.  Conversion names may be used in the
+   convert function
    to specify a particular encoding conversion.  Also, conversions that
-   are marked DEFAULT can be used for automatic encoding conversion between
+   are marked DEFAULT can be used for automatic encoding
+   conversion between
    client and server. For this purpose, two conversions, from encoding A to
    B and from encoding B to A, must be defined.
  
@@ -109,7 +111,7 @@ conv_proc(
     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;
 
index c42580d624b730e35b1e94f5298995e2626d64f7..fb71bf59f92f6660910d49f6105390d7d7656fa5 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *   $PostgreSQL: pgsql/src/backend/commands/conversioncmds.c,v 1.17 2005/04/14 20:03:23 tgl Exp $
+ *   $PostgreSQL: pgsql/src/backend/commands/conversioncmds.c,v 1.18 2005/05/03 19:17:59 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -45,7 +45,7 @@ CreateConversionCommand(CreateConversionStmt *stmt)
    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,
index 18009da163fdb915f8f0a54d769b0dd5d68b07f5..72e0e92c425f2a10b578eb21737b0a0e49a89da4 100644 (file)
@@ -4,7 +4,7 @@
 #    Makefile for utils/mb/conversion_procs
 #
 # IDENTIFICATION
-#    $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/Makefile,v 1.13 2005/03/14 18:31:21 momjian Exp $
+#    $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/Makefile,v 1.14 2005/05/03 19:17:59 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -159,7 +159,7 @@ ifeq ($(enable_shared), yes)
        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 > $@