@@ -2075,16 +2075,18 @@ memcpy(destination->data, buffer, 40);
2075
2075
</para>
2076
2076
2077
2077
<para>
2078
- <xref linkend="xfunc-c-type-table"/> specifies which C type
2079
- corresponds to which SQL type when writing a C-language function
2080
- that uses a built-in type of <productname>PostgreSQL</productname>.
2078
+ <xref linkend="xfunc-c-type-table"/> shows the C types
2079
+ corresponding to many of the built-in SQL data types
2080
+ of <productname>PostgreSQL</productname>.
2081
2081
The <quote>Defined In</quote> column gives the header file that
2082
2082
needs to be included to get the type definition. (The actual
2083
2083
definition might be in a different file that is included by the
2084
2084
listed file. It is recommended that users stick to the defined
2085
2085
interface.) Note that you should always include
2086
- <filename>postgres.h</filename> first in any source file, because
2087
- it declares a number of things that you will need anyway.
2086
+ <filename>postgres.h</filename> first in any source file of server
2087
+ code, because it declares a number of things that you will need
2088
+ anyway, and because including other headers first can cause
2089
+ portability issues.
2088
2090
</para>
2089
2091
2090
2092
<table tocentry="1" id="xfunc-c-type-table">
@@ -2140,28 +2142,28 @@ memcpy(destination->data, buffer, 40);
2140
2142
<entry><filename>utils/date.h</filename></entry>
2141
2143
</row>
2142
2144
<row>
2143
- <entry><type>smallint </type> (<type>int2 </type>)</entry>
2144
- <entry><type>int16 </type></entry>
2145
- <entry><filename>postgres.h</filename></entry>
2145
+ <entry><type>float4 </type> (<type>real </type>)</entry>
2146
+ <entry><type>float4 </type></entry>
2147
+ <entry><filename>postgres.h</filename></entry>
2146
2148
</row>
2147
2149
<row>
2148
- <entry><type>int2vector </type></entry>
2149
- <entry><type>int2vector* </type></entry>
2150
+ <entry><type>float8 </type> (<type>double precision</type>) </entry>
2151
+ <entry><type>float8 </type></entry>
2150
2152
<entry><filename>postgres.h</filename></entry>
2151
2153
</row>
2152
2154
<row>
2153
- <entry><type>integer </type> (<type>int4 </type>)</entry>
2154
- <entry><type>int32 </type></entry>
2155
+ <entry><type>int2 </type> (<type>smallint </type>)</entry>
2156
+ <entry><type>int16 </type></entry>
2155
2157
<entry><filename>postgres.h</filename></entry>
2156
2158
</row>
2157
2159
<row>
2158
- <entry><type>real </type> (<type>float4 </type>)</entry>
2159
- <entry><type>float4* </type></entry>
2160
- <entry><filename>postgres.h</filename></entry>
2160
+ <entry><type>int4 </type> (<type>integer </type>)</entry>
2161
+ <entry><type>int32 </type></entry>
2162
+ <entry><filename>postgres.h</filename></entry>
2161
2163
</row>
2162
2164
<row>
2163
- <entry><type>double precision </type> (<type>float8 </type>)</entry>
2164
- <entry><type>float8* </type></entry>
2165
+ <entry><type>int8 </type> (<type>bigint </type>)</entry>
2166
+ <entry><type>int64 </type></entry>
2165
2167
<entry><filename>postgres.h</filename></entry>
2166
2168
</row>
2167
2169
<row>
@@ -2179,6 +2181,11 @@ memcpy(destination->data, buffer, 40);
2179
2181
<entry><type>Name</type></entry>
2180
2182
<entry><filename>postgres.h</filename></entry>
2181
2183
</row>
2184
+ <row>
2185
+ <entry><type>numeric</type></entry>
2186
+ <entry><type>Numeric</type></entry>
2187
+ <entry><filename>utils/numeric.h</filename></entry>
2188
+ </row>
2182
2189
<row>
2183
2190
<entry><type>oid</type></entry>
2184
2191
<entry><type>Oid</type></entry>
@@ -2201,7 +2208,7 @@ memcpy(destination->data, buffer, 40);
2201
2208
</row>
2202
2209
<row>
2203
2210
<entry><type>regproc</type></entry>
2204
- <entry><type>regproc </type></entry>
2211
+ <entry><type>RegProcedure </type></entry>
2205
2212
<entry><filename>postgres.h</filename></entry>
2206
2213
</row>
2207
2214
<row>
@@ -2229,6 +2236,11 @@ memcpy(destination->data, buffer, 40);
2229
2236
<entry><type>Timestamp</type></entry>
2230
2237
<entry><filename>datatype/timestamp.h</filename></entry>
2231
2238
</row>
2239
+ <row>
2240
+ <entry><type>timestamp with time zone</type></entry>
2241
+ <entry><type>TimestampTz</type></entry>
2242
+ <entry><filename>datatype/timestamp.h</filename></entry>
2243
+ </row>
2232
2244
<row>
2233
2245
<entry><type>varchar</type></entry>
2234
2246
<entry><type>VarChar*</type></entry>
0 commit comments