Flip the default typispreferred setting from true to false. This affects
[PostgreSQL.git] / src / include / catalog / pg_type.h
blobdc5fb186052a040e7fa2cc4a1eb251f60d028e48
1 /*-------------------------------------------------------------------------
3 * pg_type.h
4 * definition of the system "type" relation (pg_type)
5 * along with the relation's initial contents.
8 * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
9 * Portions Copyright (c) 1994, Regents of the University of California
11 * $PostgreSQL$
13 * NOTES
14 * the genbki.sh script reads this file and generates .bki
15 * information from the DATA() statements.
17 *-------------------------------------------------------------------------
19 #ifndef PG_TYPE_H
20 #define PG_TYPE_H
22 #include "catalog/genbki.h"
24 /* ----------------
25 * pg_type definition. cpp turns this into
26 * typedef struct FormData_pg_type
28 * Some of the values in a pg_type instance are copied into
29 * pg_attribute instances. Some parts of Postgres use the pg_type copy,
30 * while others use the pg_attribute copy, so they must match.
31 * See struct FormData_pg_attribute for details.
32 * ----------------
34 #define TypeRelationId 1247
36 CATALOG(pg_type,1247) BKI_BOOTSTRAP
38 NameData typname; /* type name */
39 Oid typnamespace; /* OID of namespace containing this type */
40 Oid typowner; /* type owner */
43 * For a fixed-size type, typlen is the number of bytes we use to
44 * represent a value of this type, e.g. 4 for an int4. But for a
45 * variable-length type, typlen is negative. We use -1 to indicate a
46 * "varlena" type (one that has a length word), -2 to indicate a
47 * null-terminated C string.
49 int2 typlen;
52 * typbyval determines whether internal Postgres routines pass a value of
53 * this type by value or by reference. typbyval had better be FALSE if
54 * the length is not 1, 2, or 4 (or 8 on 8-byte-Datum machines).
55 * Variable-length types are always passed by reference. Note that
56 * typbyval can be false even if the length would allow pass-by-value;
57 * this is currently true for type float4, for example.
59 bool typbyval;
62 * typtype is 'b' for a base type, 'c' for a composite type (e.g., a
63 * table's rowtype), 'd' for a domain type, 'e' for an enum type, or 'p'
64 * for a pseudo-type. (Use the TYPTYPE macros below.)
66 * If typtype is 'c', typrelid is the OID of the class' entry in pg_class.
68 char typtype;
71 * typcategory and typispreferred help the parser distinguish preferred
72 * and non-preferred coercions. The category can be any single ASCII
73 * character (but not \0). The categories used for built-in types are
74 * identified by the TYPCATEGORY macros below.
76 char typcategory; /* arbitrary type classification */
78 bool typispreferred; /* is type "preferred" within its category? */
81 * If typisdefined is false, the entry is only a placeholder (forward
82 * reference). We know the type name, but not yet anything else about it.
84 bool typisdefined;
86 char typdelim; /* delimiter for arrays of this type */
88 Oid typrelid; /* 0 if not a composite type */
91 * If typelem is not 0 then it identifies another row in pg_type. The
92 * current type can then be subscripted like an array yielding values of
93 * type typelem. A non-zero typelem does not guarantee this type to be a
94 * "real" array type; some ordinary fixed-length types can also be
95 * subscripted (e.g., name, point). Variable-length types can *not* be
96 * turned into pseudo-arrays like that. Hence, the way to determine
97 * whether a type is a "true" array type is if:
99 * typelem != 0 and typlen == -1.
101 Oid typelem;
104 * If there is a "true" array type having this type as element type,
105 * typarray links to it. Zero if no associated "true" array type.
107 Oid typarray;
110 * I/O conversion procedures for the datatype.
112 regproc typinput; /* text format (required) */
113 regproc typoutput;
114 regproc typreceive; /* binary format (optional) */
115 regproc typsend;
118 * I/O functions for optional type modifiers.
120 regproc typmodin;
121 regproc typmodout;
124 * Custom ANALYZE procedure for the datatype (0 selects the default).
126 regproc typanalyze;
128 /* ----------------
129 * typalign is the alignment required when storing a value of this
130 * type. It applies to storage on disk as well as most
131 * representations of the value inside Postgres. When multiple values
132 * are stored consecutively, such as in the representation of a
133 * complete row on disk, padding is inserted before a datum of this
134 * type so that it begins on the specified boundary. The alignment
135 * reference is the beginning of the first datum in the sequence.
137 * 'c' = CHAR alignment, ie no alignment needed.
138 * 's' = SHORT alignment (2 bytes on most machines).
139 * 'i' = INT alignment (4 bytes on most machines).
140 * 'd' = DOUBLE alignment (8 bytes on many machines, but by no means all).
142 * See include/access/tupmacs.h for the macros that compute these
143 * alignment requirements. Note also that we allow the nominal alignment
144 * to be violated when storing "packed" varlenas; the TOAST mechanism
145 * takes care of hiding that from most code.
147 * NOTE: for types used in system tables, it is critical that the
148 * size and alignment defined in pg_type agree with the way that the
149 * compiler will lay out the field in a struct representing a table row.
150 * ----------------
152 char typalign;
154 /* ----------------
155 * typstorage tells if the type is prepared for toasting and what
156 * the default strategy for attributes of this type should be.
158 * 'p' PLAIN type not prepared for toasting
159 * 'e' EXTERNAL external storage possible, don't try to compress
160 * 'x' EXTENDED try to compress and store external if required
161 * 'm' MAIN like 'x' but try to keep in main tuple
162 * ----------------
164 char typstorage;
167 * This flag represents a "NOT NULL" constraint against this datatype.
169 * If true, the attnotnull column for a corresponding table column using
170 * this datatype will always enforce the NOT NULL constraint.
172 * Used primarily for domain types.
174 bool typnotnull;
177 * Domains use typbasetype to show the base (or domain) type that the
178 * domain is based on. Zero if the type is not a domain.
180 Oid typbasetype;
183 * Domains use typtypmod to record the typmod to be applied to their base
184 * type (-1 if base type does not use a typmod). -1 if this type is not a
185 * domain.
187 int4 typtypmod;
190 * typndims is the declared number of dimensions for an array domain type
191 * (i.e., typbasetype is an array type; the domain's typelem will match
192 * the base type's typelem). Otherwise zero.
194 int4 typndims;
197 * If typdefaultbin is not NULL, it is the nodeToString representation of
198 * a default expression for the type. Currently this is only used for
199 * domains.
201 text typdefaultbin; /* VARIABLE LENGTH FIELD */
204 * typdefault is NULL if the type has no associated default value. If
205 * typdefaultbin is not NULL, typdefault must contain a human-readable
206 * version of the default expression represented by typdefaultbin. If
207 * typdefaultbin is NULL and typdefault is not, then typdefault is the
208 * external representation of the type's default value, which may be fed
209 * to the type's input converter to produce a constant.
211 text typdefault; /* VARIABLE LENGTH FIELD */
213 } FormData_pg_type;
215 /* ----------------
216 * Form_pg_type corresponds to a pointer to a row with
217 * the format of pg_type relation.
218 * ----------------
220 typedef FormData_pg_type *Form_pg_type;
222 /* ----------------
223 * compiler constants for pg_type
224 * ----------------
226 #define Natts_pg_type 28
227 #define Anum_pg_type_typname 1
228 #define Anum_pg_type_typnamespace 2
229 #define Anum_pg_type_typowner 3
230 #define Anum_pg_type_typlen 4
231 #define Anum_pg_type_typbyval 5
232 #define Anum_pg_type_typtype 6
233 #define Anum_pg_type_typcategory 7
234 #define Anum_pg_type_typispreferred 8
235 #define Anum_pg_type_typisdefined 9
236 #define Anum_pg_type_typdelim 10
237 #define Anum_pg_type_typrelid 11
238 #define Anum_pg_type_typelem 12
239 #define Anum_pg_type_typarray 13
240 #define Anum_pg_type_typinput 14
241 #define Anum_pg_type_typoutput 15
242 #define Anum_pg_type_typreceive 16
243 #define Anum_pg_type_typsend 17
244 #define Anum_pg_type_typmodin 18
245 #define Anum_pg_type_typmodout 19
246 #define Anum_pg_type_typanalyze 20
247 #define Anum_pg_type_typalign 21
248 #define Anum_pg_type_typstorage 22
249 #define Anum_pg_type_typnotnull 23
250 #define Anum_pg_type_typbasetype 24
251 #define Anum_pg_type_typtypmod 25
252 #define Anum_pg_type_typndims 26
253 #define Anum_pg_type_typdefaultbin 27
254 #define Anum_pg_type_typdefault 28
257 /* ----------------
258 * initial contents of pg_type
259 * ----------------
263 * Keep the following ordered by OID so that later changes can be made more
264 * easily.
266 * For types used in the system catalogs, make sure the typlen, typbyval, and
267 * typalign values here match the initial values for attlen, attbyval, and
268 * attalign in both places in pg_attribute.h for every instance. Also see
269 * TypInfo[] in bootstrap.c.
272 /* OIDS 1 - 99 */
273 DATA(insert OID = 16 ( bool PGNSP PGUID 1 t b B t t \054 0 0 1000 boolin boolout boolrecv boolsend - - - c p f 0 -1 0 _null_ _null_ ));
274 DESCR("boolean, 'true'/'false'");
275 #define BOOLOID 16
277 DATA(insert OID = 17 ( bytea PGNSP PGUID -1 f b U f t \054 0 0 1001 byteain byteaout bytearecv byteasend - - - i x f 0 -1 0 _null_ _null_ ));
278 DESCR("variable-length string, binary values escaped");
279 #define BYTEAOID 17
281 DATA(insert OID = 18 ( char PGNSP PGUID 1 t b S f t \054 0 0 1002 charin charout charrecv charsend - - - c p f 0 -1 0 _null_ _null_ ));
282 DESCR("single character");
283 #define CHAROID 18
285 DATA(insert OID = 19 ( name PGNSP PGUID NAMEDATALEN f b S f t \054 0 18 1003 namein nameout namerecv namesend - - - c p f 0 -1 0 _null_ _null_ ));
286 DESCR("63-character type for storing system identifiers");
287 #define NAMEOID 19
289 DATA(insert OID = 20 ( int8 PGNSP PGUID 8 FLOAT8PASSBYVAL b N f t \054 0 0 1016 int8in int8out int8recv int8send - - - d p f 0 -1 0 _null_ _null_ ));
290 DESCR("~18 digit integer, 8-byte storage");
291 #define INT8OID 20
293 DATA(insert OID = 21 ( int2 PGNSP PGUID 2 t b N f t \054 0 0 1005 int2in int2out int2recv int2send - - - s p f 0 -1 0 _null_ _null_ ));
294 DESCR("-32 thousand to 32 thousand, 2-byte storage");
295 #define INT2OID 21
297 DATA(insert OID = 22 ( int2vector PGNSP PGUID -1 f b A f t \054 0 21 1006 int2vectorin int2vectorout int2vectorrecv int2vectorsend - - - i p f 0 -1 0 _null_ _null_ ));
298 DESCR("array of int2, used in system tables");
299 #define INT2VECTOROID 22
301 DATA(insert OID = 23 ( int4 PGNSP PGUID 4 t b N f t \054 0 0 1007 int4in int4out int4recv int4send - - - i p f 0 -1 0 _null_ _null_ ));
302 DESCR("-2 billion to 2 billion integer, 4-byte storage");
303 #define INT4OID 23
305 DATA(insert OID = 24 ( regproc PGNSP PGUID 4 t b N f t \054 0 0 1008 regprocin regprocout regprocrecv regprocsend - - - i p f 0 -1 0 _null_ _null_ ));
306 DESCR("registered procedure");
307 #define REGPROCOID 24
309 DATA(insert OID = 25 ( text PGNSP PGUID -1 f b S t t \054 0 0 1009 textin textout textrecv textsend - - - i x f 0 -1 0 _null_ _null_ ));
310 DESCR("variable-length string, no limit specified");
311 #define TEXTOID 25
313 DATA(insert OID = 26 ( oid PGNSP PGUID 4 t b N t t \054 0 0 1028 oidin oidout oidrecv oidsend - - - i p f 0 -1 0 _null_ _null_ ));
314 DESCR("object identifier(oid), maximum 4 billion");
315 #define OIDOID 26
317 DATA(insert OID = 27 ( tid PGNSP PGUID 6 f b U f t \054 0 0 1010 tidin tidout tidrecv tidsend - - - s p f 0 -1 0 _null_ _null_ ));
318 DESCR("(block, offset), physical location of tuple");
319 #define TIDOID 27
321 DATA(insert OID = 28 ( xid PGNSP PGUID 4 t b U f t \054 0 0 1011 xidin xidout xidrecv xidsend - - - i p f 0 -1 0 _null_ _null_ ));
322 DESCR("transaction id");
323 #define XIDOID 28
325 DATA(insert OID = 29 ( cid PGNSP PGUID 4 t b U f t \054 0 0 1012 cidin cidout cidrecv cidsend - - - i p f 0 -1 0 _null_ _null_ ));
326 DESCR("command identifier type, sequence in transaction id");
327 #define CIDOID 29
329 DATA(insert OID = 30 ( oidvector PGNSP PGUID -1 f b A f t \054 0 26 1013 oidvectorin oidvectorout oidvectorrecv oidvectorsend - - - i p f 0 -1 0 _null_ _null_ ));
330 DESCR("array of oids, used in system tables");
331 #define OIDVECTOROID 30
333 /* hand-built rowtype entries for bootstrapped catalogs: */
335 DATA(insert OID = 71 ( pg_type PGNSP PGUID -1 f c C f t \054 1247 0 0 record_in record_out record_recv record_send - - - d x f 0 -1 0 _null_ _null_ ));
336 #define PG_TYPE_RELTYPE_OID 71
337 DATA(insert OID = 75 ( pg_attribute PGNSP PGUID -1 f c C f t \054 1249 0 0 record_in record_out record_recv record_send - - - d x f 0 -1 0 _null_ _null_ ));
338 #define PG_ATTRIBUTE_RELTYPE_OID 75
339 DATA(insert OID = 81 ( pg_proc PGNSP PGUID -1 f c C f t \054 1255 0 0 record_in record_out record_recv record_send - - - d x f 0 -1 0 _null_ _null_ ));
340 #define PG_PROC_RELTYPE_OID 81
341 DATA(insert OID = 83 ( pg_class PGNSP PGUID -1 f c C f t \054 1259 0 0 record_in record_out record_recv record_send - - - d x f 0 -1 0 _null_ _null_ ));
342 #define PG_CLASS_RELTYPE_OID 83
344 /* OIDS 100 - 199 */
345 DATA(insert OID = 142 ( xml PGNSP PGUID -1 f b U f t \054 0 0 143 xml_in xml_out xml_recv xml_send - - - i x f 0 -1 0 _null_ _null_ ));
346 DESCR("XML content");
347 #define XMLOID 142
348 DATA(insert OID = 143 ( _xml PGNSP PGUID -1 f b A f t \054 0 142 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
350 /* OIDS 200 - 299 */
352 DATA(insert OID = 210 ( smgr PGNSP PGUID 2 t b U f t \054 0 0 0 smgrin smgrout - - - - - s p f 0 -1 0 _null_ _null_ ));
353 DESCR("storage manager");
355 /* OIDS 300 - 399 */
357 /* OIDS 400 - 499 */
359 /* OIDS 500 - 599 */
361 /* OIDS 600 - 699 */
362 DATA(insert OID = 600 ( point PGNSP PGUID 16 f b G f t \054 0 701 1017 point_in point_out point_recv point_send - - - d p f 0 -1 0 _null_ _null_ ));
363 DESCR("geometric point '(x, y)'");
364 #define POINTOID 600
365 DATA(insert OID = 601 ( lseg PGNSP PGUID 32 f b G f t \054 0 600 1018 lseg_in lseg_out lseg_recv lseg_send - - - d p f 0 -1 0 _null_ _null_ ));
366 DESCR("geometric line segment '(pt1,pt2)'");
367 #define LSEGOID 601
368 DATA(insert OID = 602 ( path PGNSP PGUID -1 f b G f t \054 0 0 1019 path_in path_out path_recv path_send - - - d x f 0 -1 0 _null_ _null_ ));
369 DESCR("geometric path '(pt1,...)'");
370 #define PATHOID 602
371 DATA(insert OID = 603 ( box PGNSP PGUID 32 f b G f t \073 0 600 1020 box_in box_out box_recv box_send - - - d p f 0 -1 0 _null_ _null_ ));
372 DESCR("geometric box '(lower left,upper right)'");
373 #define BOXOID 603
374 DATA(insert OID = 604 ( polygon PGNSP PGUID -1 f b G f t \054 0 0 1027 poly_in poly_out poly_recv poly_send - - - d x f 0 -1 0 _null_ _null_ ));
375 DESCR("geometric polygon '(pt1,...)'");
376 #define POLYGONOID 604
378 DATA(insert OID = 628 ( line PGNSP PGUID 32 f b G f t \054 0 701 629 line_in line_out line_recv line_send - - - d p f 0 -1 0 _null_ _null_ ));
379 DESCR("geometric line (not implemented)'");
380 #define LINEOID 628
381 DATA(insert OID = 629 ( _line PGNSP PGUID -1 f b A f t \054 0 628 0 array_in array_out array_recv array_send - - - d x f 0 -1 0 _null_ _null_ ));
382 DESCR("");
384 /* OIDS 700 - 799 */
386 DATA(insert OID = 700 ( float4 PGNSP PGUID 4 FLOAT4PASSBYVAL b N f t \054 0 0 1021 float4in float4out float4recv float4send - - - i p f 0 -1 0 _null_ _null_ ));
387 DESCR("single-precision floating point number, 4-byte storage");
388 #define FLOAT4OID 700
389 DATA(insert OID = 701 ( float8 PGNSP PGUID 8 FLOAT8PASSBYVAL b N t t \054 0 0 1022 float8in float8out float8recv float8send - - - d p f 0 -1 0 _null_ _null_ ));
390 DESCR("double-precision floating point number, 8-byte storage");
391 #define FLOAT8OID 701
392 DATA(insert OID = 702 ( abstime PGNSP PGUID 4 t b D f t \054 0 0 1023 abstimein abstimeout abstimerecv abstimesend - - - i p f 0 -1 0 _null_ _null_ ));
393 DESCR("absolute, limited-range date and time (Unix system time)");
394 #define ABSTIMEOID 702
395 DATA(insert OID = 703 ( reltime PGNSP PGUID 4 t b T f t \054 0 0 1024 reltimein reltimeout reltimerecv reltimesend - - - i p f 0 -1 0 _null_ _null_ ));
396 DESCR("relative, limited-range time interval (Unix delta time)");
397 #define RELTIMEOID 703
398 DATA(insert OID = 704 ( tinterval PGNSP PGUID 12 f b T f t \054 0 0 1025 tintervalin tintervalout tintervalrecv tintervalsend - - - i p f 0 -1 0 _null_ _null_ ));
399 DESCR("(abstime,abstime), time interval");
400 #define TINTERVALOID 704
401 DATA(insert OID = 705 ( unknown PGNSP PGUID -2 f b X f t \054 0 0 0 unknownin unknownout unknownrecv unknownsend - - - c p f 0 -1 0 _null_ _null_ ));
402 DESCR("");
403 #define UNKNOWNOID 705
405 DATA(insert OID = 718 ( circle PGNSP PGUID 24 f b G f t \054 0 0 719 circle_in circle_out circle_recv circle_send - - - d p f 0 -1 0 _null_ _null_ ));
406 DESCR("geometric circle '(center,radius)'");
407 #define CIRCLEOID 718
408 DATA(insert OID = 719 ( _circle PGNSP PGUID -1 f b A f t \054 0 718 0 array_in array_out array_recv array_send - - - d x f 0 -1 0 _null_ _null_ ));
409 DATA(insert OID = 790 ( money PGNSP PGUID 8 FLOAT8PASSBYVAL b N f t \054 0 0 791 cash_in cash_out cash_recv cash_send - - - d p f 0 -1 0 _null_ _null_ ));
410 DESCR("monetary amounts, $d,ddd.cc");
411 #define CASHOID 790
412 DATA(insert OID = 791 ( _money PGNSP PGUID -1 f b A f t \054 0 790 0 array_in array_out array_recv array_send - - - d x f 0 -1 0 _null_ _null_ ));
414 /* OIDS 800 - 899 */
415 DATA(insert OID = 829 ( macaddr PGNSP PGUID 6 f b U f t \054 0 0 1040 macaddr_in macaddr_out macaddr_recv macaddr_send - - - i p f 0 -1 0 _null_ _null_ ));
416 DESCR("XX:XX:XX:XX:XX:XX, MAC address");
417 #define MACADDROID 829
418 DATA(insert OID = 869 ( inet PGNSP PGUID -1 f b I t t \054 0 0 1041 inet_in inet_out inet_recv inet_send - - - i m f 0 -1 0 _null_ _null_ ));
419 DESCR("IP address/netmask, host address, netmask optional");
420 #define INETOID 869
421 DATA(insert OID = 650 ( cidr PGNSP PGUID -1 f b I f t \054 0 0 651 cidr_in cidr_out cidr_recv cidr_send - - - i m f 0 -1 0 _null_ _null_ ));
422 DESCR("network IP address/netmask, network address");
423 #define CIDROID 650
425 /* OIDS 900 - 999 */
427 /* OIDS 1000 - 1099 */
428 DATA(insert OID = 1000 ( _bool PGNSP PGUID -1 f b A f t \054 0 16 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
429 DATA(insert OID = 1001 ( _bytea PGNSP PGUID -1 f b A f t \054 0 17 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
430 DATA(insert OID = 1002 ( _char PGNSP PGUID -1 f b A f t \054 0 18 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
431 DATA(insert OID = 1003 ( _name PGNSP PGUID -1 f b A f t \054 0 19 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
432 DATA(insert OID = 1005 ( _int2 PGNSP PGUID -1 f b A f t \054 0 21 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
433 DATA(insert OID = 1006 ( _int2vector PGNSP PGUID -1 f b A f t \054 0 22 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
434 DATA(insert OID = 1007 ( _int4 PGNSP PGUID -1 f b A f t \054 0 23 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
435 #define INT4ARRAYOID 1007
436 DATA(insert OID = 1008 ( _regproc PGNSP PGUID -1 f b A f t \054 0 24 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
437 DATA(insert OID = 1009 ( _text PGNSP PGUID -1 f b A f t \054 0 25 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
438 DATA(insert OID = 1028 ( _oid PGNSP PGUID -1 f b A f t \054 0 26 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
439 DATA(insert OID = 1010 ( _tid PGNSP PGUID -1 f b A f t \054 0 27 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
440 DATA(insert OID = 1011 ( _xid PGNSP PGUID -1 f b A f t \054 0 28 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
441 DATA(insert OID = 1012 ( _cid PGNSP PGUID -1 f b A f t \054 0 29 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
442 DATA(insert OID = 1013 ( _oidvector PGNSP PGUID -1 f b A f t \054 0 30 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
443 DATA(insert OID = 1014 ( _bpchar PGNSP PGUID -1 f b A f t \054 0 1042 0 array_in array_out array_recv array_send bpchartypmodin bpchartypmodout - i x f 0 -1 0 _null_ _null_ ));
444 DATA(insert OID = 1015 ( _varchar PGNSP PGUID -1 f b A f t \054 0 1043 0 array_in array_out array_recv array_send varchartypmodin varchartypmodout - i x f 0 -1 0 _null_ _null_ ));
445 DATA(insert OID = 1016 ( _int8 PGNSP PGUID -1 f b A f t \054 0 20 0 array_in array_out array_recv array_send - - - d x f 0 -1 0 _null_ _null_ ));
446 DATA(insert OID = 1017 ( _point PGNSP PGUID -1 f b A f t \054 0 600 0 array_in array_out array_recv array_send - - - d x f 0 -1 0 _null_ _null_ ));
447 DATA(insert OID = 1018 ( _lseg PGNSP PGUID -1 f b A f t \054 0 601 0 array_in array_out array_recv array_send - - - d x f 0 -1 0 _null_ _null_ ));
448 DATA(insert OID = 1019 ( _path PGNSP PGUID -1 f b A f t \054 0 602 0 array_in array_out array_recv array_send - - - d x f 0 -1 0 _null_ _null_ ));
449 DATA(insert OID = 1020 ( _box PGNSP PGUID -1 f b A f t \054 0 603 0 array_in array_out array_recv array_send - - - d x f 0 -1 0 _null_ _null_ ));
450 DATA(insert OID = 1021 ( _float4 PGNSP PGUID -1 f b A f t \054 0 700 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
451 #define FLOAT4ARRAYOID 1021
452 DATA(insert OID = 1022 ( _float8 PGNSP PGUID -1 f b A f t \054 0 701 0 array_in array_out array_recv array_send - - - d x f 0 -1 0 _null_ _null_ ));
453 DATA(insert OID = 1023 ( _abstime PGNSP PGUID -1 f b A f t \054 0 702 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
454 DATA(insert OID = 1024 ( _reltime PGNSP PGUID -1 f b A f t \054 0 703 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
455 DATA(insert OID = 1025 ( _tinterval PGNSP PGUID -1 f b A f t \054 0 704 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
456 DATA(insert OID = 1027 ( _polygon PGNSP PGUID -1 f b A f t \054 0 604 0 array_in array_out array_recv array_send - - - d x f 0 -1 0 _null_ _null_ ));
457 DATA(insert OID = 1033 ( aclitem PGNSP PGUID 12 f b U f t \054 0 0 1034 aclitemin aclitemout - - - - - i p f 0 -1 0 _null_ _null_ ));
458 DESCR("access control list");
459 #define ACLITEMOID 1033
460 DATA(insert OID = 1034 ( _aclitem PGNSP PGUID -1 f b A f t \054 0 1033 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
461 DATA(insert OID = 1040 ( _macaddr PGNSP PGUID -1 f b A f t \054 0 829 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
462 DATA(insert OID = 1041 ( _inet PGNSP PGUID -1 f b A f t \054 0 869 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
463 DATA(insert OID = 651 ( _cidr PGNSP PGUID -1 f b A f t \054 0 650 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
464 DATA(insert OID = 1263 ( _cstring PGNSP PGUID -1 f b A f t \054 0 2275 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
465 #define CSTRINGARRAYOID 1263
467 DATA(insert OID = 1042 ( bpchar PGNSP PGUID -1 f b S f t \054 0 0 1014 bpcharin bpcharout bpcharrecv bpcharsend bpchartypmodin bpchartypmodout - i x f 0 -1 0 _null_ _null_ ));
468 DESCR("char(length), blank-padded string, fixed storage length");
469 #define BPCHAROID 1042
470 DATA(insert OID = 1043 ( varchar PGNSP PGUID -1 f b S f t \054 0 0 1015 varcharin varcharout varcharrecv varcharsend varchartypmodin varchartypmodout - i x f 0 -1 0 _null_ _null_ ));
471 DESCR("varchar(length), non-blank-padded string, variable storage length");
472 #define VARCHAROID 1043
474 DATA(insert OID = 1082 ( date PGNSP PGUID 4 t b D f t \054 0 0 1182 date_in date_out date_recv date_send - - - i p f 0 -1 0 _null_ _null_ ));
475 DESCR("ANSI SQL date");
476 #define DATEOID 1082
477 DATA(insert OID = 1083 ( time PGNSP PGUID 8 FLOAT8PASSBYVAL b D f t \054 0 0 1183 time_in time_out time_recv time_send timetypmodin timetypmodout - d p f 0 -1 0 _null_ _null_ ));
478 DESCR("hh:mm:ss, ANSI SQL time");
479 #define TIMEOID 1083
481 /* OIDS 1100 - 1199 */
482 DATA(insert OID = 1114 ( timestamp PGNSP PGUID 8 FLOAT8PASSBYVAL b D f t \054 0 0 1115 timestamp_in timestamp_out timestamp_recv timestamp_send timestamptypmodin timestamptypmodout - d p f 0 -1 0 _null_ _null_ ));
483 DESCR("date and time");
484 #define TIMESTAMPOID 1114
485 DATA(insert OID = 1115 ( _timestamp PGNSP PGUID -1 f b A f t \054 0 1114 0 array_in array_out array_recv array_send timestamptypmodin timestamptypmodout - d x f 0 -1 0 _null_ _null_ ));
486 DATA(insert OID = 1182 ( _date PGNSP PGUID -1 f b A f t \054 0 1082 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
487 DATA(insert OID = 1183 ( _time PGNSP PGUID -1 f b A f t \054 0 1083 0 array_in array_out array_recv array_send timetypmodin timetypmodout - d x f 0 -1 0 _null_ _null_ ));
488 DATA(insert OID = 1184 ( timestamptz PGNSP PGUID 8 FLOAT8PASSBYVAL b D t t \054 0 0 1185 timestamptz_in timestamptz_out timestamptz_recv timestamptz_send timestamptztypmodin timestamptztypmodout - d p f 0 -1 0 _null_ _null_ ));
489 DESCR("date and time with time zone");
490 #define TIMESTAMPTZOID 1184
491 DATA(insert OID = 1185 ( _timestamptz PGNSP PGUID -1 f b A f t \054 0 1184 0 array_in array_out array_recv array_send timestamptztypmodin timestamptztypmodout - d x f 0 -1 0 _null_ _null_ ));
492 DATA(insert OID = 1186 ( interval PGNSP PGUID 16 f b T t t \054 0 0 1187 interval_in interval_out interval_recv interval_send intervaltypmodin intervaltypmodout - d p f 0 -1 0 _null_ _null_ ));
493 DESCR("@ <number> <units>, time interval");
494 #define INTERVALOID 1186
495 DATA(insert OID = 1187 ( _interval PGNSP PGUID -1 f b A f t \054 0 1186 0 array_in array_out array_recv array_send intervaltypmodin intervaltypmodout - d x f 0 -1 0 _null_ _null_ ));
497 /* OIDS 1200 - 1299 */
498 DATA(insert OID = 1231 ( _numeric PGNSP PGUID -1 f b A f t \054 0 1700 0 array_in array_out array_recv array_send numerictypmodin numerictypmodout - i x f 0 -1 0 _null_ _null_ ));
499 DATA(insert OID = 1266 ( timetz PGNSP PGUID 12 f b D f t \054 0 0 1270 timetz_in timetz_out timetz_recv timetz_send timetztypmodin timetztypmodout - d p f 0 -1 0 _null_ _null_ ));
500 DESCR("hh:mm:ss, ANSI SQL time");
501 #define TIMETZOID 1266
502 DATA(insert OID = 1270 ( _timetz PGNSP PGUID -1 f b A f t \054 0 1266 0 array_in array_out array_recv array_send timetztypmodin timetztypmodout - d x f 0 -1 0 _null_ _null_ ));
504 /* OIDS 1500 - 1599 */
505 DATA(insert OID = 1560 ( bit PGNSP PGUID -1 f b V f t \054 0 0 1561 bit_in bit_out bit_recv bit_send bittypmodin bittypmodout - i x f 0 -1 0 _null_ _null_ ));
506 DESCR("fixed-length bit string");
507 #define BITOID 1560
508 DATA(insert OID = 1561 ( _bit PGNSP PGUID -1 f b A f t \054 0 1560 0 array_in array_out array_recv array_send bittypmodin bittypmodout - i x f 0 -1 0 _null_ _null_ ));
509 DATA(insert OID = 1562 ( varbit PGNSP PGUID -1 f b V t t \054 0 0 1563 varbit_in varbit_out varbit_recv varbit_send varbittypmodin varbittypmodout - i x f 0 -1 0 _null_ _null_ ));
510 DESCR("variable-length bit string");
511 #define VARBITOID 1562
512 DATA(insert OID = 1563 ( _varbit PGNSP PGUID -1 f b A f t \054 0 1562 0 array_in array_out array_recv array_send varbittypmodin varbittypmodout - i x f 0 -1 0 _null_ _null_ ));
514 /* OIDS 1600 - 1699 */
516 /* OIDS 1700 - 1799 */
517 DATA(insert OID = 1700 ( numeric PGNSP PGUID -1 f b N f t \054 0 0 1231 numeric_in numeric_out numeric_recv numeric_send numerictypmodin numerictypmodout - i m f 0 -1 0 _null_ _null_ ));
518 DESCR("numeric(precision, decimal), arbitrary precision number");
519 #define NUMERICOID 1700
521 DATA(insert OID = 1790 ( refcursor PGNSP PGUID -1 f b U f t \054 0 0 2201 textin textout textrecv textsend - - - i x f 0 -1 0 _null_ _null_ ));
522 DESCR("reference cursor (portal name)");
523 #define REFCURSOROID 1790
525 /* OIDS 2200 - 2299 */
526 DATA(insert OID = 2201 ( _refcursor PGNSP PGUID -1 f b A f t \054 0 1790 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
528 DATA(insert OID = 2202 ( regprocedure PGNSP PGUID 4 t b N f t \054 0 0 2207 regprocedurein regprocedureout regprocedurerecv regproceduresend - - - i p f 0 -1 0 _null_ _null_ ));
529 DESCR("registered procedure (with args)");
530 #define REGPROCEDUREOID 2202
532 DATA(insert OID = 2203 ( regoper PGNSP PGUID 4 t b N f t \054 0 0 2208 regoperin regoperout regoperrecv regopersend - - - i p f 0 -1 0 _null_ _null_ ));
533 DESCR("registered operator");
534 #define REGOPEROID 2203
536 DATA(insert OID = 2204 ( regoperator PGNSP PGUID 4 t b N f t \054 0 0 2209 regoperatorin regoperatorout regoperatorrecv regoperatorsend - - - i p f 0 -1 0 _null_ _null_ ));
537 DESCR("registered operator (with args)");
538 #define REGOPERATOROID 2204
540 DATA(insert OID = 2205 ( regclass PGNSP PGUID 4 t b N f t \054 0 0 2210 regclassin regclassout regclassrecv regclasssend - - - i p f 0 -1 0 _null_ _null_ ));
541 DESCR("registered class");
542 #define REGCLASSOID 2205
544 DATA(insert OID = 2206 ( regtype PGNSP PGUID 4 t b N f t \054 0 0 2211 regtypein regtypeout regtyperecv regtypesend - - - i p f 0 -1 0 _null_ _null_ ));
545 DESCR("registered type");
546 #define REGTYPEOID 2206
548 DATA(insert OID = 2207 ( _regprocedure PGNSP PGUID -1 f b A f t \054 0 2202 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
549 DATA(insert OID = 2208 ( _regoper PGNSP PGUID -1 f b A f t \054 0 2203 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
550 DATA(insert OID = 2209 ( _regoperator PGNSP PGUID -1 f b A f t \054 0 2204 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
551 DATA(insert OID = 2210 ( _regclass PGNSP PGUID -1 f b A f t \054 0 2205 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
552 DATA(insert OID = 2211 ( _regtype PGNSP PGUID -1 f b A f t \054 0 2206 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
553 #define REGTYPEARRAYOID 2211
555 /* uuid */
556 DATA(insert OID = 2950 ( uuid PGNSP PGUID 16 f b U f t \054 0 0 2951 uuid_in uuid_out uuid_recv uuid_send - - - c p f 0 -1 0 _null_ _null_ ));
557 DESCR("UUID datatype");
558 DATA(insert OID = 2951 ( _uuid PGNSP PGUID -1 f b A f t \054 0 2950 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
560 /* text search */
561 DATA(insert OID = 3614 ( tsvector PGNSP PGUID -1 f b U f t \054 0 0 3643 tsvectorin tsvectorout tsvectorrecv tsvectorsend - - ts_typanalyze i x f 0 -1 0 _null_ _null_ ));
562 DESCR("text representation for text search");
563 #define TSVECTOROID 3614
564 DATA(insert OID = 3642 ( gtsvector PGNSP PGUID -1 f b U f t \054 0 0 3644 gtsvectorin gtsvectorout - - - - - i p f 0 -1 0 _null_ _null_ ));
565 DESCR("GiST index internal text representation for text search");
566 #define GTSVECTOROID 3642
567 DATA(insert OID = 3615 ( tsquery PGNSP PGUID -1 f b U f t \054 0 0 3645 tsqueryin tsqueryout tsqueryrecv tsquerysend - - - i p f 0 -1 0 _null_ _null_ ));
568 DESCR("query representation for text search");
569 #define TSQUERYOID 3615
570 DATA(insert OID = 3734 ( regconfig PGNSP PGUID 4 t b N f t \054 0 0 3735 regconfigin regconfigout regconfigrecv regconfigsend - - - i p f 0 -1 0 _null_ _null_ ));
571 DESCR("registered text search configuration");
572 #define REGCONFIGOID 3734
573 DATA(insert OID = 3769 ( regdictionary PGNSP PGUID 4 t b N f t \054 0 0 3770 regdictionaryin regdictionaryout regdictionaryrecv regdictionarysend - - - i p f 0 -1 0 _null_ _null_ ));
574 DESCR("registered text search dictionary");
575 #define REGDICTIONARYOID 3769
577 DATA(insert OID = 3643 ( _tsvector PGNSP PGUID -1 f b A f t \054 0 3614 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
578 DATA(insert OID = 3644 ( _gtsvector PGNSP PGUID -1 f b A f t \054 0 3642 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
579 DATA(insert OID = 3645 ( _tsquery PGNSP PGUID -1 f b A f t \054 0 3615 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
580 DATA(insert OID = 3735 ( _regconfig PGNSP PGUID -1 f b A f t \054 0 3734 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
581 DATA(insert OID = 3770 ( _regdictionary PGNSP PGUID -1 f b A f t \054 0 3769 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
583 DATA(insert OID = 2970 ( txid_snapshot PGNSP PGUID -1 f b U f t \054 0 0 2949 txid_snapshot_in txid_snapshot_out txid_snapshot_recv txid_snapshot_send - - - d x f 0 -1 0 _null_ _null_ ));
584 DESCR("txid snapshot");
585 DATA(insert OID = 2949 ( _txid_snapshot PGNSP PGUID -1 f b A f t \054 0 2970 0 array_in array_out array_recv array_send - - - d x f 0 -1 0 _null_ _null_ ));
588 * pseudo-types
590 * types with typtype='p' represent various special cases in the type system.
592 * These cannot be used to define table columns, but are valid as function
593 * argument and result types (if supported by the function's implementation
594 * language).
596 * Note: cstring is a borderline case; it is still considered a pseudo-type,
597 * but there is now support for it in records and arrays. Perhaps we should
598 * just treat it as a regular base type?
600 DATA(insert OID = 2249 ( record PGNSP PGUID -1 f p P f t \054 0 0 0 record_in record_out record_recv record_send - - - d x f 0 -1 0 _null_ _null_ ));
601 #define RECORDOID 2249
602 DATA(insert OID = 2275 ( cstring PGNSP PGUID -2 f p P f t \054 0 0 1263 cstring_in cstring_out cstring_recv cstring_send - - - c p f 0 -1 0 _null_ _null_ ));
603 #define CSTRINGOID 2275
604 DATA(insert OID = 2276 ( any PGNSP PGUID 4 t p P f t \054 0 0 0 any_in any_out - - - - - i p f 0 -1 0 _null_ _null_ ));
605 #define ANYOID 2276
606 DATA(insert OID = 2277 ( anyarray PGNSP PGUID -1 f p P f t \054 0 0 0 anyarray_in anyarray_out anyarray_recv anyarray_send - - - d x f 0 -1 0 _null_ _null_ ));
607 #define ANYARRAYOID 2277
608 DATA(insert OID = 2278 ( void PGNSP PGUID 4 t p P f t \054 0 0 0 void_in void_out - - - - - i p f 0 -1 0 _null_ _null_ ));
609 #define VOIDOID 2278
610 DATA(insert OID = 2279 ( trigger PGNSP PGUID 4 t p P f t \054 0 0 0 trigger_in trigger_out - - - - - i p f 0 -1 0 _null_ _null_ ));
611 #define TRIGGEROID 2279
612 DATA(insert OID = 2280 ( language_handler PGNSP PGUID 4 t p P f t \054 0 0 0 language_handler_in language_handler_out - - - - - i p f 0 -1 0 _null_ _null_ ));
613 #define LANGUAGE_HANDLEROID 2280
614 DATA(insert OID = 2281 ( internal PGNSP PGUID 4 t p P f t \054 0 0 0 internal_in internal_out - - - - - i p f 0 -1 0 _null_ _null_ ));
615 #define INTERNALOID 2281
616 DATA(insert OID = 2282 ( opaque PGNSP PGUID 4 t p P f t \054 0 0 0 opaque_in opaque_out - - - - - i p f 0 -1 0 _null_ _null_ ));
617 #define OPAQUEOID 2282
618 DATA(insert OID = 2283 ( anyelement PGNSP PGUID 4 t p P f t \054 0 0 0 anyelement_in anyelement_out - - - - - i p f 0 -1 0 _null_ _null_ ));
619 #define ANYELEMENTOID 2283
620 DATA(insert OID = 2776 ( anynonarray PGNSP PGUID 4 t p P f t \054 0 0 0 anynonarray_in anynonarray_out - - - - - i p f 0 -1 0 _null_ _null_ ));
621 #define ANYNONARRAYOID 2776
622 DATA(insert OID = 3500 ( anyenum PGNSP PGUID 4 t p P f t \054 0 0 0 anyenum_in anyenum_out - - - - - i p f 0 -1 0 _null_ _null_ ));
623 #define ANYENUMOID 3500
627 * macros
629 #define TYPTYPE_BASE 'b' /* base type (ordinary scalar type) */
630 #define TYPTYPE_COMPOSITE 'c' /* composite (e.g., table's rowtype) */
631 #define TYPTYPE_DOMAIN 'd' /* domain over another type */
632 #define TYPTYPE_ENUM 'e' /* enumerated type */
633 #define TYPTYPE_PSEUDO 'p' /* pseudo-type */
635 #define TYPCATEGORY_INVALID '\0' /* not an allowed category */
636 #define TYPCATEGORY_ARRAY 'A'
637 #define TYPCATEGORY_BOOLEAN 'B'
638 #define TYPCATEGORY_COMPOSITE 'C'
639 #define TYPCATEGORY_DATETIME 'D'
640 #define TYPCATEGORY_ENUM 'E'
641 #define TYPCATEGORY_GEOMETRIC 'G'
642 #define TYPCATEGORY_NETWORK 'I' /* think INET */
643 #define TYPCATEGORY_NUMERIC 'N'
644 #define TYPCATEGORY_PSEUDOTYPE 'P'
645 #define TYPCATEGORY_STRING 'S'
646 #define TYPCATEGORY_TIMESPAN 'T'
647 #define TYPCATEGORY_USER 'U'
648 #define TYPCATEGORY_BITSTRING 'V' /* er ... "varbit"? */
649 #define TYPCATEGORY_UNKNOWN 'X'
651 /* Is a type OID a polymorphic pseudotype? (Beware of multiple evaluation) */
652 #define IsPolymorphicType(typid) \
653 ((typid) == ANYELEMENTOID || \
654 (typid) == ANYARRAYOID || \
655 (typid) == ANYNONARRAYOID || \
656 (typid) == ANYENUMOID)
658 #endif /* PG_TYPE_H */