mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-05 01:07:21 +02:00
Doc: improve xfunc-c-type-table.
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
This commit is contained in:
parent
da57b1529c
commit
d393831eea
@ -2075,16 +2075,18 @@ memcpy(destination->data, buffer, 40);
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
<xref linkend="xfunc-c-type-table"/> specifies which C type
|
<xref linkend="xfunc-c-type-table"/> shows the C types
|
||||||
corresponds to which SQL type when writing a C-language function
|
corresponding to many of the built-in SQL data types
|
||||||
that uses a built-in type of <productname>PostgreSQL</productname>.
|
of <productname>PostgreSQL</productname>.
|
||||||
The <quote>Defined In</quote> column gives the header file that
|
The <quote>Defined In</quote> column gives the header file that
|
||||||
needs to be included to get the type definition. (The actual
|
needs to be included to get the type definition. (The actual
|
||||||
definition might be in a different file that is included by the
|
definition might be in a different file that is included by the
|
||||||
listed file. It is recommended that users stick to the defined
|
listed file. It is recommended that users stick to the defined
|
||||||
interface.) Note that you should always include
|
interface.) Note that you should always include
|
||||||
<filename>postgres.h</filename> first in any source file, because
|
<filename>postgres.h</filename> first in any source file of server
|
||||||
it declares a number of things that you will need anyway.
|
code, because it declares a number of things that you will need
|
||||||
|
anyway, and because including other headers first can cause
|
||||||
|
portability issues.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<table tocentry="1" id="xfunc-c-type-table">
|
<table tocentry="1" id="xfunc-c-type-table">
|
||||||
@ -2109,11 +2111,6 @@ memcpy(destination->data, buffer, 40);
|
|||||||
<entry><type>AbsoluteTime</type></entry>
|
<entry><type>AbsoluteTime</type></entry>
|
||||||
<entry><filename>utils/nabstime.h</filename></entry>
|
<entry><filename>utils/nabstime.h</filename></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
|
||||||
<entry><type>bigint</type> (<type>int8</type>)</entry>
|
|
||||||
<entry><type>int64</type></entry>
|
|
||||||
<entry><filename>postgres.h</filename></entry>
|
|
||||||
</row>
|
|
||||||
<row>
|
<row>
|
||||||
<entry><type>boolean</type></entry>
|
<entry><type>boolean</type></entry>
|
||||||
<entry><type>bool</type></entry>
|
<entry><type>bool</type></entry>
|
||||||
@ -2150,28 +2147,28 @@ memcpy(destination->data, buffer, 40);
|
|||||||
<entry><filename>utils/date.h</filename></entry>
|
<entry><filename>utils/date.h</filename></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><type>smallint</type> (<type>int2</type>)</entry>
|
<entry><type>float4</type> (<type>real</type>)</entry>
|
||||||
|
<entry><type>float4</type></entry>
|
||||||
|
<entry><filename>postgres.h</filename></entry>
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<entry><type>float8</type> (<type>double precision</type>)</entry>
|
||||||
|
<entry><type>float8</type></entry>
|
||||||
|
<entry><filename>postgres.h</filename></entry>
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<entry><type>int2</type> (<type>smallint</type>)</entry>
|
||||||
<entry><type>int16</type></entry>
|
<entry><type>int16</type></entry>
|
||||||
<entry><filename>postgres.h</filename></entry>
|
<entry><filename>postgres.h</filename></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><type>int2vector</type></entry>
|
<entry><type>int4</type> (<type>integer</type>)</entry>
|
||||||
<entry><type>int2vector*</type></entry>
|
|
||||||
<entry><filename>postgres.h</filename></entry>
|
|
||||||
</row>
|
|
||||||
<row>
|
|
||||||
<entry><type>integer</type> (<type>int4</type>)</entry>
|
|
||||||
<entry><type>int32</type></entry>
|
<entry><type>int32</type></entry>
|
||||||
<entry><filename>postgres.h</filename></entry>
|
<entry><filename>postgres.h</filename></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><type>real</type> (<type>float4</type>)</entry>
|
<entry><type>int8</type> (<type>bigint</type>)</entry>
|
||||||
<entry><type>float4*</type></entry>
|
<entry><type>int64</type></entry>
|
||||||
<entry><filename>postgres.h</filename></entry>
|
|
||||||
</row>
|
|
||||||
<row>
|
|
||||||
<entry><type>double precision</type> (<type>float8</type>)</entry>
|
|
||||||
<entry><type>float8*</type></entry>
|
|
||||||
<entry><filename>postgres.h</filename></entry>
|
<entry><filename>postgres.h</filename></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
@ -2189,6 +2186,11 @@ memcpy(destination->data, buffer, 40);
|
|||||||
<entry><type>Name</type></entry>
|
<entry><type>Name</type></entry>
|
||||||
<entry><filename>postgres.h</filename></entry>
|
<entry><filename>postgres.h</filename></entry>
|
||||||
</row>
|
</row>
|
||||||
|
<row>
|
||||||
|
<entry><type>numeric</type></entry>
|
||||||
|
<entry><type>Numeric</type></entry>
|
||||||
|
<entry><filename>utils/numeric.h</filename></entry>
|
||||||
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><type>oid</type></entry>
|
<entry><type>oid</type></entry>
|
||||||
<entry><type>Oid</type></entry>
|
<entry><type>Oid</type></entry>
|
||||||
@ -2211,7 +2213,7 @@ memcpy(destination->data, buffer, 40);
|
|||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><type>regproc</type></entry>
|
<entry><type>regproc</type></entry>
|
||||||
<entry><type>regproc</type></entry>
|
<entry><type>RegProcedure</type></entry>
|
||||||
<entry><filename>postgres.h</filename></entry>
|
<entry><filename>postgres.h</filename></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
@ -2244,6 +2246,11 @@ memcpy(destination->data, buffer, 40);
|
|||||||
<entry><type>Timestamp</type></entry>
|
<entry><type>Timestamp</type></entry>
|
||||||
<entry><filename>datatype/timestamp.h</filename></entry>
|
<entry><filename>datatype/timestamp.h</filename></entry>
|
||||||
</row>
|
</row>
|
||||||
|
<row>
|
||||||
|
<entry><type>timestamp with time zone</type></entry>
|
||||||
|
<entry><type>TimestampTz</type></entry>
|
||||||
|
<entry><filename>datatype/timestamp.h</filename></entry>
|
||||||
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><type>tinterval</type></entry>
|
<entry><type>tinterval</type></entry>
|
||||||
<entry><type>TimeInterval</type></entry>
|
<entry><type>TimeInterval</type></entry>
|
||||||
|
Loading…
Reference in New Issue
Block a user