Doc: improve xfunc-c-type-table.
authorTom Lane
Wed, 8 Dec 2021 21:54:31 +0000 (16:54 -0500)
committerTom Lane
Wed, 8 Dec 2021 21:54:52 +0000 (16:54 -0500)
List types numeric and timestamptz, which don't seem to have ever been
included here.  Restore bigint, which was no-doubt-accidentally deleted
in v12.  Fix some errors, or at least obsolete usages (nobody declares
float arguments as "float8*" anymore, even though they might be that
under the hood).  Re-alphabetize.  Remove the seeming claim that this
is a complete list of built-in types.

Per question from Oskar Stenberg.

Discussion: https://postgr.es/m/HE1PR03MB2971DE2527ECE1E99D6C19A8F96E9@HE1PR03MB2971.eurprd03.prod.outlook.com

doc/src/sgml/xfunc.sgml

index 0d5590973488a071f4891493f910ecd04be4d676..a34723030b0cc37d85d2b1be2c7f6922fa722d9b 100644 (file)
@@ -2166,16 +2166,18 @@ memcpy(destination->data, buffer, 40);
     
 
     
-      specifies which C type
-     corresponds to which SQL type when writing a C-language function
-     that uses a built-in type of PostgreSQL.
+      shows the C types
+     corresponding to many of the built-in SQL data types
+     of PostgreSQL.
      The Defined In column gives the header file that
      needs to be included to get the type definition.  (The actual
      definition might be in a different file that is included by the
      listed file.  It is recommended that users stick to the defined
      interface.)  Note that you should always include
-     postgres.h first in any source file, because
-     it declares a number of things that you will need anyway.
+     postgres.h first in any source file of server
+     code, because it declares a number of things that you will need
+     anyway, and because including other headers first can cause
+     portability issues.
     
 
      
@@ -2234,28 +2236,28 @@ memcpy(destination->data, buffer, 40);
          utils/date.h
         
         
-         smallint (int2)
-         int16
-         postgres.h
+         float4 (real)
+         float4
+        postgres.h
         
         
-         int2vector
-         int2vector*
+         float8 (double precision)
+         float8
          postgres.h
         
         
-         integer (int4)
-         int32
+         int2 (smallint)
+         int16
          postgres.h
         
         
-         real (float4)
-         float4*
-        postgres.h
+         int4 (integer)
+         int32
+         postgres.h
         
         
-         double precision (float8)
-         float8*
+         int8 (bigint)
+         int64
          postgres.h
         
         
@@ -2273,6 +2275,11 @@ memcpy(destination->data, buffer, 40);
          Name
          postgres.h
         
+        
+         numeric
+         Numeric
+         utils/numeric.h
+        
         
          oid
          Oid
@@ -2295,7 +2302,7 @@ memcpy(destination->data, buffer, 40);
         
         
          regproc
-         regproc
+         RegProcedure
          postgres.h
         
         
@@ -2323,6 +2330,11 @@ memcpy(destination->data, buffer, 40);
          Timestamp
          datatype/timestamp.h
         
+        
+         timestamp with time zone
+         TimestampTz
+         datatype/timestamp.h
+        
         
          varchar
          VarChar*