@@ -2166,16 +2166,18 @@ memcpy(destination->data, buffer, 40);
2166
2166
</para>
2167
2167
2168
2168
<para>
2169
- <xref linkend="xfunc-c-type-table"/> specifies which C type
2170
- corresponds to which SQL type when writing a C-language function
2171
- that uses a built-in type of <productname>PostgreSQL</productname>.
2169
+ <xref linkend="xfunc-c-type-table"/> shows the C types
2170
+ corresponding to many of the built-in SQL data types
2171
+ of <productname>PostgreSQL</productname>.
2172
2172
The <quote>Defined In</quote> column gives the header file that
2173
2173
needs to be included to get the type definition. (The actual
2174
2174
definition might be in a different file that is included by the
2175
2175
listed file. It is recommended that users stick to the defined
2176
2176
interface.) Note that you should always include
2177
- <filename>postgres.h</filename> first in any source file, because
2178
- it declares a number of things that you will need anyway.
2177
+ <filename>postgres.h</filename> first in any source file of server
2178
+ code, because it declares a number of things that you will need
2179
+ anyway, and because including other headers first can cause
2180
+ portability issues.
2179
2181
</para>
2180
2182
2181
2183
<table tocentry="1" id="xfunc-c-type-table">
@@ -2234,28 +2236,28 @@ memcpy(destination->data, buffer, 40);
2234
2236
<entry><filename>utils/date.h</filename></entry>
2235
2237
</row>
2236
2238
<row>
2237
- <entry><type>smallint </type> (<type>int2 </type>)</entry>
2238
- <entry><type>int16 </type></entry>
2239
- <entry><filename>postgres.h</filename></entry>
2239
+ <entry><type>float4 </type> (<type>real </type>)</entry>
2240
+ <entry><type>float4 </type></entry>
2241
+ <entry><filename>postgres.h</filename></entry>
2240
2242
</row>
2241
2243
<row>
2242
- <entry><type>int2vector </type></entry>
2243
- <entry><type>int2vector* </type></entry>
2244
+ <entry><type>float8 </type> (<type>double precision</type>) </entry>
2245
+ <entry><type>float8 </type></entry>
2244
2246
<entry><filename>postgres.h</filename></entry>
2245
2247
</row>
2246
2248
<row>
2247
- <entry><type>integer </type> (<type>int4 </type>)</entry>
2248
- <entry><type>int32 </type></entry>
2249
+ <entry><type>int2 </type> (<type>smallint </type>)</entry>
2250
+ <entry><type>int16 </type></entry>
2249
2251
<entry><filename>postgres.h</filename></entry>
2250
2252
</row>
2251
2253
<row>
2252
- <entry><type>real </type> (<type>float4 </type>)</entry>
2253
- <entry><type>float4* </type></entry>
2254
- <entry><filename>postgres.h</filename></entry>
2254
+ <entry><type>int4 </type> (<type>integer </type>)</entry>
2255
+ <entry><type>int32 </type></entry>
2256
+ <entry><filename>postgres.h</filename></entry>
2255
2257
</row>
2256
2258
<row>
2257
- <entry><type>double precision </type> (<type>float8 </type>)</entry>
2258
- <entry><type>float8* </type></entry>
2259
+ <entry><type>int8 </type> (<type>bigint </type>)</entry>
2260
+ <entry><type>int64 </type></entry>
2259
2261
<entry><filename>postgres.h</filename></entry>
2260
2262
</row>
2261
2263
<row>
@@ -2273,6 +2275,11 @@ memcpy(destination->data, buffer, 40);
2273
2275
<entry><type>Name</type></entry>
2274
2276
<entry><filename>postgres.h</filename></entry>
2275
2277
</row>
2278
+ <row>
2279
+ <entry><type>numeric</type></entry>
2280
+ <entry><type>Numeric</type></entry>
2281
+ <entry><filename>utils/numeric.h</filename></entry>
2282
+ </row>
2276
2283
<row>
2277
2284
<entry><type>oid</type></entry>
2278
2285
<entry><type>Oid</type></entry>
@@ -2295,7 +2302,7 @@ memcpy(destination->data, buffer, 40);
2295
2302
</row>
2296
2303
<row>
2297
2304
<entry><type>regproc</type></entry>
2298
- <entry><type>regproc </type></entry>
2305
+ <entry><type>RegProcedure </type></entry>
2299
2306
<entry><filename>postgres.h</filename></entry>
2300
2307
</row>
2301
2308
<row>
@@ -2323,6 +2330,11 @@ memcpy(destination->data, buffer, 40);
2323
2330
<entry><type>Timestamp</type></entry>
2324
2331
<entry><filename>datatype/timestamp.h</filename></entry>
2325
2332
</row>
2333
+ <row>
2334
+ <entry><type>timestamp with time zone</type></entry>
2335
+ <entry><type>TimestampTz</type></entry>
2336
+ <entry><filename>datatype/timestamp.h</filename></entry>
2337
+ </row>
2326
2338
<row>
2327
2339
<entry><type>varchar</type></entry>
2328
2340
<entry><type>VarChar*</type></entry>
0 commit comments