pg_type.h 21.5 KB
Newer Older
1 2
/*-------------------------------------------------------------------------
 *
3
 * pg_type.h
4 5
 *	  definition of the system "type" relation (pg_type)
 *	  along with the relation's initial contents.
6 7
 *
 *
B
Add:  
Bruce Momjian 已提交
8 9
 * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
 * Portions Copyright (c) 1994, Regents of the University of California
10
 *
11
 * $Id: pg_type.h,v 1.95 2000/07/29 18:46:00 tgl Exp $
12 13
 *
 * NOTES
14 15
 *	  the genbki.sh script reads this file and generates .bki
 *	  information from the DATA() statements.
16 17 18 19 20 21 22
 *
 *-------------------------------------------------------------------------
 */
#ifndef PG_TYPE_H
#define PG_TYPE_H

/* ----------------
23
 *		postgres.h contains the system type definitions and the
24 25
 *		CATALOG(), BOOTSTRAP and DATA() sugar words so this file
 *		can be read by both genbki.sh and the C compiler.
26 27 28 29
 * ----------------
 */

/* ----------------
30 31
 *		pg_type definition.  cpp turns this into
 *		typedef struct FormData_pg_type
32
 *
33 34 35 36
 *		Some of the values in a pg_type instance are copied into
 *		pg_attribute instances.  Some parts of Postgres use the pg_type copy,
 *		while others use the pg_attribute copy, so they must match.
 *		See struct FormData_pg_attribute for details.
37 38
 * ----------------
 */
39 40
CATALOG(pg_type) BOOTSTRAP
{
41
	NameData	typname;
42
	int4		typowner;
43 44 45 46 47 48

	/*
	 * typlen is the number of bytes we use to represent a value of this
	 * type, e.g. 4 for an int4.  But for a variable length type, typlen
	 * is -1.
	 */
49
	int2		typlen;
50
	int2		typprtlen;
51 52 53

	/*
	 * typbyval determines whether internal Postgres routines pass a value
54
	 * of this type by value or by reference.  Only char, short, and int-
B
Bruce Momjian 已提交
55 56 57 58 59 60
	 * equivalent items can be passed by value, so if the type is not 1,
	 * 2, or 4 bytes long, Postgres does not have the option of passing by
	 * value and so typbyval had better be FALSE.  Variable-length types
	 * are always passed by reference. Note that typbyval can be false
	 * even if the length would allow pass-by-value; this is currently
	 * true for type float4, for example.
61
	 */
B
Bruce Momjian 已提交
62
	bool		typbyval;
63 64

	/*
B
Bruce Momjian 已提交
65 66 67 68
	 * typtype is 'b' for a basic type and 'c' for a catalog type (ie a
	 * class). If typtype is 'c', typrelid is the OID of the class' entry
	 * in pg_class. (Why do we need an entry in pg_type for classes,
	 * anyway?)
69
	 */
70
	char		typtype;
71 72
	bool		typisdefined;
	char		typdelim;
73
	Oid			typrelid;		/* 0 if not a class type */
74 75

	/*
76 77 78
	 * If typelem is not 0 then it identifies another row in pg_type.
	 * The current type can then be subscripted like an array yielding
	 * values of type typelem. A non-zero typelem does not guarantee
79 80 81 82 83
	 * this type to be a "real" array type; some ordinary fixed-length
	 * types can also be subscripted (e.g., oidvector). Variable-length
	 * types can *not* be turned into pseudo-arrays like that. Hence,
	 * the way to determine whether a type is a "true" array type is
	 * typelem != 0 and typlen < 0.
84
	 */
85
	Oid			typelem;
86 87 88 89
	regproc		typinput;
	regproc		typoutput;
	regproc		typreceive;
	regproc		typsend;
90

91
	/* ----------------
92 93 94 95 96 97 98 99
	 * typalign is the alignment required when storing a value of this
	 * type.  It applies to storage on disk as well as most
	 * representations of the value inside Postgres.  When multiple values
	 * are stored consecutively, such as in the representation of a
	 * complete row on disk, padding is inserted before a datum of this
	 * type so that it begins on the specified boundary.  The alignment
	 * reference is the beginning of the first datum in the sequence.
	 *
100 101 102 103 104 105 106
	 * 'c' = CHAR alignment, ie no alignment needed.
	 * 's' = SHORT alignment (2 bytes on most machines).
	 * 'i' = INT alignment (4 bytes on most machines).
	 * 'd' = DOUBLE alignment (8 bytes on many machines, but by no means all).
	 *
	 * See include/utils/memutils.h for the macros that compute these
	 * alignment requirements.
107
	 *
108 109 110 111
	 * NOTE: for types used in system tables, it is critical that the
	 * size and alignment defined in pg_type agree with the way that the
	 * compiler will lay out the field in a struct representing a table row.
	 * ----------------
112
	 */
113
	char		typalign;
J
TOAST  
Jan Wieck 已提交
114 115 116 117 118 119 120 121 122 123 124

	/* ----------------
	 * typstorage tells if the type is prepared for toasting and what
	 * the default strategy for attributes of this type should be.
	 *
	 * 'p' PLAIN      type not prepared for toasting
	 * 'e' EXTERNAL   external storage possible, don't try to compress
	 * 'x' EXTENDED   try to compress and store external if required
	 * 'm' MAIN       like 'x' but try to keep in main tuple
	 * ----------------
	 */
125 126
	char		typstorage;

127
	text		typdefault;		/* VARIABLE LENGTH FIELD */
128
} FormData_pg_type;
129 130

/* ----------------
131 132
 *		Form_pg_type corresponds to a pointer to a row with
 *		the format of pg_type relation.
133 134
 * ----------------
 */
135
typedef FormData_pg_type *Form_pg_type;
136 137

/* ----------------
138
 *		compiler constants for pg_type
139 140
 * ----------------
 */
J
TOAST  
Jan Wieck 已提交
141
#define Natts_pg_type					17
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
#define Anum_pg_type_typname			1
#define Anum_pg_type_typowner			2
#define Anum_pg_type_typlen				3
#define Anum_pg_type_typprtlen			4
#define Anum_pg_type_typbyval			5
#define Anum_pg_type_typtype			6
#define Anum_pg_type_typisdefined		7
#define Anum_pg_type_typdelim			8
#define Anum_pg_type_typrelid			9
#define Anum_pg_type_typelem			10
#define Anum_pg_type_typinput			11
#define Anum_pg_type_typoutput			12
#define Anum_pg_type_typreceive			13
#define Anum_pg_type_typsend			14
#define Anum_pg_type_typalign			15
J
TOAST  
Jan Wieck 已提交
157 158
#define Anum_pg_type_typstorage			16
#define Anum_pg_type_typdefault			17
159 160

/* ----------------
161
 *		initial contents of pg_type
162 163 164 165 166 167
 * ----------------
 */

/* keep the following ordered by OID so that later changes can be made easier*/

/* Make sure the typlen, typbyval, and typalign values here match the initial
168
   values for attlen, attbyval, and attalign in both places in pg_attribute.h
169 170 171 172
   for every instance.
*/

/* OIDS 1 - 99 */
J
TOAST  
Jan Wieck 已提交
173
DATA(insert OID = 16 (	bool	   PGUID  1   1 t b t \054 0   0 boolin boolout boolin boolout c p _null_ ));
B
Bruce Momjian 已提交
174
DESCR("boolean, 'true'/'false'");
175
#define BOOLOID			16
176

177
DATA(insert OID = 17 (	bytea	   PGUID -1  -1 f b t \054 0  0 byteain byteaout byteain byteaout i x _null_ ));
B
Bruce Momjian 已提交
178
DESCR("variable-length string, binary values escaped");
179 180
#define BYTEAOID		17

J
TOAST  
Jan Wieck 已提交
181
DATA(insert OID = 18 (	char	   PGUID  1   1 t b t \054 0   0 charin charout charin charout c p _null_ ));
182
DESCR("single character");
183
#define CHAROID			18
184

J
TOAST  
Jan Wieck 已提交
185
DATA(insert OID = 19 (	name	   PGUID NAMEDATALEN NAMEDATALEN  f b t \054 0	18 namein nameout namein nameout i p _null_ ));
186
DESCR("31-character type for storing system identifiers");
187 188
#define NAMEOID			19

J
TOAST  
Jan Wieck 已提交
189
DATA(insert OID = 20 (	int8	   PGUID  8  20 f b t \054 0   0 int8in int8out int8in int8out d p _null_ ));
B
Bruce Momjian 已提交
190
DESCR("~18 digit integer, 8-byte storage");
191
#define INT8OID			20
192

J
TOAST  
Jan Wieck 已提交
193
DATA(insert OID = 21 (	int2	   PGUID  2   5 t b t \054 0   0 int2in int2out int2in int2out s p _null_ ));
B
Bruce Momjian 已提交
194
DESCR("-32 thousand to 32 thousand, 2-byte storage");
195
#define INT2OID			21
196

J
TOAST  
Jan Wieck 已提交
197
DATA(insert OID = 22 (	int2vector PGUID INDEX_MAX_KEYS*2 -1 f b t \054 0  21 int2vectorin int2vectorout int2vectorin int2vectorout i p _null_ ));
198
DESCR("array of INDEX_MAX_KEYS int2 integers, used in system tables");
199
#define INT2VECTOROID	22
200

J
TOAST  
Jan Wieck 已提交
201
DATA(insert OID = 23 (	int4	   PGUID  4  10 t b t \054 0   0 int4in int4out int4in int4out i p _null_ ));
B
Bruce Momjian 已提交
202
DESCR("-2 billion to 2 billion integer, 4-byte storage");
203
#define INT4OID			23
204

J
TOAST  
Jan Wieck 已提交
205
DATA(insert OID = 24 (	regproc    PGUID  4  16 t b t \054 0   0 regprocin regprocout regprocin regprocout i p _null_ ));
206
DESCR("registered procedure");
207 208
#define REGPROCOID		24

209
DATA(insert OID = 25 (	text	   PGUID -1  -1 f b t \054 0  0 textin textout textin textout i x _null_ ));
B
Bruce Momjian 已提交
210
DESCR("variable-length string, no limit specified");
211
#define TEXTOID			25
212

J
TOAST  
Jan Wieck 已提交
213
DATA(insert OID = 26 (	oid		   PGUID  4  10 t b t \054 0   0 oidin oidout oidin oidout i p _null_ ));
B
Bruce Momjian 已提交
214
DESCR("object identifier(oid), maximum 4 billion");
215 216
#define OIDOID			26

J
TOAST  
Jan Wieck 已提交
217
DATA(insert OID = 27 (	tid		   PGUID  6  19 f b t \054 0   0 tidin tidout tidin tidout i p _null_ ));
B
Bruce Momjian 已提交
218
DESCR("(Block, offset), physical location of tuple");
219 220
#define TIDOID		27

J
TOAST  
Jan Wieck 已提交
221
DATA(insert OID = 28 (	xid		   PGUID  4  12 t b t \054 0   0 xidin xidout xidin xidout i p _null_ ));
222
DESCR("transaction id");
223 224
#define XIDOID 28

J
TOAST  
Jan Wieck 已提交
225
DATA(insert OID = 29 (	cid		   PGUID  4  10 t b t \054 0   0 cidin cidout cidin cidout i p _null_ ));
226
DESCR("command identifier type, sequence in transaction id");
227 228
#define CIDOID 29

J
TOAST  
Jan Wieck 已提交
229
DATA(insert OID = 30 (	oidvector  PGUID INDEX_MAX_KEYS*4 -1 f b t \054 0  26 oidvectorin oidvectorout oidvectorin oidvectorout i p _null_ ));
230
DESCR("array of INDEX_MAX_KEYS oids, used in system tables");
231 232
#define OIDVECTOROID	30

J
TOAST  
Jan Wieck 已提交
233
DATA(insert OID = 32 (	SET		   PGUID -1  -1 f b t \054 0   0 textin textout textin textout i p _null_ ));
234
DESCR("set of tuples");
235

J
TOAST  
Jan Wieck 已提交
236 237 238 239 240 241 242 243 244
DATA(insert OID = 71 (	pg_type		 PGUID 4 4 t c t \054 1247 0 int4in int4out int4in int4out i p _null_));
DATA(insert OID = 75 (	pg_attribute PGUID 4 4 t c t \054 1249 0 int4in int4out int4in int4out i p _null_));
DATA(insert OID = 81 (	pg_proc		 PGUID 4 4 t c t \054 1255 0 int4in int4out int4in int4out i p _null_));
DATA(insert OID = 83 (	pg_class	 PGUID 4 4 t c t \054 1259 0 int4in int4out int4in int4out i p _null_));
DATA(insert OID = 86 (	pg_shadow	 PGUID 4 4 t c t \054 1260 0 int4in int4out int4in int4out i p _null_));
DATA(insert OID = 87 (	pg_group	 PGUID 4 4 t c t \054 1261 0 int4in int4out int4in int4out i p _null_));
DATA(insert OID = 88 (	pg_database  PGUID 4 4 t c t \054 1262 0 int4in int4out int4in int4out i p _null_));
DATA(insert OID = 90 (	pg_variable  PGUID 4 4 t c t \054 1264 0 int4in int4out int4in int4out i p _null_));
DATA(insert OID = 99 (	pg_log		 PGUID 4 4 t c t \054 1269 0 int4in int4out int4in int4out i p _null_));
245 246 247

/* OIDS 100 - 199 */

J
TOAST  
Jan Wieck 已提交
248 249 250
DATA(insert OID = 109 (  pg_attrdef  PGUID 4 4 t c t \054 1215 0 int4in int4out int4in int4out i p _null_));
DATA(insert OID = 110 (  pg_relcheck PGUID 4 4 t c t \054 1216 0 int4in int4out int4in int4out i p _null_));
DATA(insert OID = 111 (  pg_trigger  PGUID 4 4 t c t \054 1219 0 int4in int4out int4in int4out i p _null_));
251 252 253

/* OIDS 200 - 299 */

J
TOAST  
Jan Wieck 已提交
254
DATA(insert OID = 210 (  smgr	   PGUID 2	12 t b t \054 0 0 smgrin smgrout smgrin smgrout s p _null_ ));
255
DESCR("storage manager");
256 257 258 259 260 261 262 263

/* OIDS 300 - 399 */

/* OIDS 400 - 499 */

/* OIDS 500 - 599 */

/* OIDS 600 - 699 */
J
TOAST  
Jan Wieck 已提交
264
DATA(insert OID = 600 (  point	   PGUID 16  24 f b t \054 0 701 point_in point_out point_in point_out d p _null_ ));
265
DESCR("geometric point '(x, y)'");
266
#define POINTOID		600
J
TOAST  
Jan Wieck 已提交
267
DATA(insert OID = 601 (  lseg	   PGUID 32  48 f b t \054 0 600 lseg_in lseg_out lseg_in lseg_out d p _null_ ));
268
DESCR("geometric line segment '(pt1,pt2)'");
269
#define LSEGOID			601
270
DATA(insert OID = 602 (  path	   PGUID -1  -1 f b t \054 0 0 path_in path_out path_in path_out d x _null_ ));
271
DESCR("geometric path '(pt1,...)'");
272
#define PATHOID			602
J
TOAST  
Jan Wieck 已提交
273
DATA(insert OID = 603 (  box	   PGUID 32 100 f b t \073 0 600 box_in box_out box_in box_out d p _null_ ));
274
DESCR("geometric box '(lower left,upper right)'");
275
#define BOXOID			603
276
DATA(insert OID = 604 (  polygon   PGUID -1  -1 f b t \054 0   0 poly_in poly_out poly_in poly_out d x _null_ ));
277
DESCR("geometric polygon '(pt1,...)'");
278
#define POLYGONOID		604
J
TOAST  
Jan Wieck 已提交
279
DATA(insert OID = 605 (  filename  PGUID 256 -1 f b t \054 0  18 filename_in filename_out filename_in filename_out i p _null_ ));
280
DESCR("filename used in system tables");
281

J
TOAST  
Jan Wieck 已提交
282
DATA(insert OID = 628 (  line	   PGUID 32  48 f b t \054 0 701 line_in line_out line_in line_out d p _null_ ));
283
DESCR("geometric line '(pt1,pt2)'");
284
#define LINEOID			628
285
DATA(insert OID = 629 (  _line	   PGUID  -1 -1 f b t \054 0 628 array_in array_out array_in array_out d x _null_ ));
286
DESCR("");
287 288 289

/* OIDS 700 - 799 */

J
TOAST  
Jan Wieck 已提交
290
DATA(insert OID = 700 (  float4    PGUID  4  12 f b t \054 0   0 float4in float4out float4in float4out i p _null_ ));
B
Bruce Momjian 已提交
291
DESCR("single-precision floating point number, 4-byte storage");
292
#define FLOAT4OID 700
J
TOAST  
Jan Wieck 已提交
293
DATA(insert OID = 701 (  float8    PGUID  8  24 f b t \054 0   0 float8in float8out float8in float8out d p _null_ ));
B
Bruce Momjian 已提交
294
DESCR("double-precision floating point number, 8-byte storage");
295
#define FLOAT8OID 701
J
TOAST  
Jan Wieck 已提交
296
DATA(insert OID = 702 (  abstime   PGUID  4  20 t b t \054 0   0 nabstimein nabstimeout nabstimein nabstimeout i p _null_ ));
297
DESCR("absolute, limited-range date and time (Unix system time)");
298
#define ABSTIMEOID		702
J
TOAST  
Jan Wieck 已提交
299
DATA(insert OID = 703 (  reltime   PGUID  4  20 t b t \054 0   0 reltimein reltimeout reltimein reltimeout i p _null_ ));
300
DESCR("relative, limited-range time interval (Unix delta time)");
301
#define RELTIMEOID		703
J
TOAST  
Jan Wieck 已提交
302
DATA(insert OID = 704 (  tinterval PGUID 12  47 f b t \054 0   0 tintervalin tintervalout tintervalin tintervalout i p _null_ ));
B
Bruce Momjian 已提交
303
DESCR("(abstime,abstime), time interval");
304
#define TINTERVALOID	704
305
DATA(insert OID = 705 (  unknown   PGUID -1  -1 f b t \054 0   0 textin textout textin textout i p _null_ ));
306
DESCR("");
307
#define UNKNOWNOID		705
308

J
TOAST  
Jan Wieck 已提交
309
DATA(insert OID = 718 (  circle    PGUID  24 47 f b t \054 0	0 circle_in circle_out circle_in circle_out d p _null_ ));
310
DESCR("geometric circle '(center,radius)'");
311
#define CIRCLEOID		718
312
DATA(insert OID = 719 (  _circle   PGUID  -1 -1 f b t \054 0  718 array_in array_out array_in array_out d x _null_ ));
J
TOAST  
Jan Wieck 已提交
313
DATA(insert OID = 790 (  money	   PGUID   4 24 f b t \054 0	0 cash_in cash_out cash_in cash_out i p _null_ ));
B
Bruce Momjian 已提交
314
DESCR("$d,ddd.cc, money");
315
#define CASHOID 790
316
DATA(insert OID = 791 (  _money    PGUID  -1 -1 f b t \054 0  790 array_in array_out array_in array_out i x _null_ ));
317

318
/* OIDS 800 - 899 */
J
TOAST  
Jan Wieck 已提交
319
DATA(insert OID = 829 ( macaddr    PGUID  6 -1 f b t \054 0 0 macaddr_in macaddr_out macaddr_in macaddr_out i p _null_ ));
B
Bruce Momjian 已提交
320
DESCR("XX:XX:XX:XX:XX, MAC address");
J
TOAST  
Jan Wieck 已提交
321
DATA(insert OID = 869 ( inet	   PGUID  -1 -1 f b t \054 0 0 inet_in inet_out inet_in inet_out i p _null_ ));
B
Bruce Momjian 已提交
322
DESCR("IP address/netmask, host address, netmask optional");
323
#define INETOID 869
J
TOAST  
Jan Wieck 已提交
324
DATA(insert OID = 650 ( cidr	   PGUID  -1 -1 f b t \054 0 0 cidr_in cidr_out cidr_in cidr_out i p _null_ ));
B
Bruce Momjian 已提交
325
DESCR("network IP address/netmask, network address");
326
#define CIDROID 650
327 328 329 330

/* OIDS 900 - 999 */

/* OIDS 1000 - 1099 */
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358
DATA(insert OID = 1000 (  _bool		 PGUID -1  -1 f b t \054 0	16 array_in array_out array_in array_out i x _null_ ));
DATA(insert OID = 1001 (  _bytea	 PGUID -1  -1 f b t \054 0	17 array_in array_out array_in array_out i x _null_ ));
DATA(insert OID = 1002 (  _char		 PGUID -1  -1 f b t \054 0	18 array_in array_out array_in array_out i x _null_ ));
DATA(insert OID = 1003 (  _name		 PGUID -1  -1 f b t \054 0	19 array_in array_out array_in array_out i x _null_ ));
DATA(insert OID = 1005 (  _int2		 PGUID -1  -1 f b t \054 0	21 array_in array_out array_in array_out i x _null_ ));
DATA(insert OID = 1006 (  _int2vector PGUID -1 -1 f b t \054 0	22 array_in array_out array_in array_out i x _null_ ));
DATA(insert OID = 1007 (  _int4		 PGUID -1  -1 f b t \054 0	23 array_in array_out array_in array_out i x _null_ ));
DATA(insert OID = 1008 (  _regproc	 PGUID -1  -1 f b t \054 0	24 array_in array_out array_in array_out i x _null_ ));
DATA(insert OID = 1009 (  _text		 PGUID -1  -1 f b t \054 0	25 array_in array_out array_in array_out i x _null_ ));
DATA(insert OID = 1028 (  _oid		 PGUID -1  -1 f b t \054 0	26 array_in array_out array_in array_out i x _null_ ));
DATA(insert OID = 1010 (  _tid		 PGUID -1  -1 f b t \054 0	27 array_in array_out array_in array_out i x _null_ ));
DATA(insert OID = 1011 (  _xid		 PGUID -1  -1 f b t \054 0	28 array_in array_out array_in array_out i x _null_ ));
DATA(insert OID = 1012 (  _cid		 PGUID -1  -1 f b t \054 0	29 array_in array_out array_in array_out i x _null_ ));
DATA(insert OID = 1013 (  _oidvector PGUID -1  -1 f b t \054 0	30 array_in array_out array_in array_out i x _null_ ));
DATA(insert OID = 1014 (  _bpchar	 PGUID -1  -1 f b t \054 0 1042 array_in array_out array_in array_out i x _null_ ));
DATA(insert OID = 1015 (  _varchar	 PGUID -1  -1 f b t \054 0 1043 array_in array_out array_in array_out i x _null_ ));
DATA(insert OID = 1016 (  _int8		 PGUID -1  -1 f b t \054 0	20 array_in array_out array_in array_out d x _null_ ));
DATA(insert OID = 1017 (  _point	 PGUID -1  -1 f b t \054 0 600 array_in array_out array_in array_out d x _null_ ));
DATA(insert OID = 1018 (  _lseg		 PGUID -1  -1 f b t \054 0 601 array_in array_out array_in array_out d x _null_ ));
DATA(insert OID = 1019 (  _path		 PGUID -1  -1 f b t \054 0 602 array_in array_out array_in array_out d x _null_ ));
DATA(insert OID = 1020 (  _box		 PGUID -1  -1 f b t \073 0 603 array_in array_out array_in array_out d x _null_ ));
DATA(insert OID = 1021 (  _float4	 PGUID -1  -1 f b t \054 0 700 array_in array_out array_in array_out i x _null_ ));
DATA(insert OID = 1022 (  _float8	 PGUID -1  -1 f b t \054 0 701 array_in array_out array_in array_out d x _null_ ));
DATA(insert OID = 1023 (  _abstime	 PGUID -1  -1 f b t \054 0 702 array_in array_out array_in array_out i x _null_ ));
DATA(insert OID = 1024 (  _reltime	 PGUID -1  -1 f b t \054 0 703 array_in array_out array_in array_out i x _null_ ));
DATA(insert OID = 1025 (  _tinterval PGUID -1  -1 f b t \054 0 704 array_in array_out array_in array_out i x _null_ ));
DATA(insert OID = 1026 (  _filename  PGUID -1  -1 f b t \054 0 605 array_in array_out array_in array_out i x _null_ ));
DATA(insert OID = 1027 (  _polygon	 PGUID -1  -1 f b t \054 0 604 array_in array_out array_in array_out d x _null_ ));
359 360 361 362 363
/*
 *	Note: the size of aclitem needs to match sizeof(AclItem) in acl.h.
 *	Thanks to some padding, this will be 8 on all platforms.
 *	We also have an Assert to make sure.
 */
364
#define ACLITEMSIZE 8
J
TOAST  
Jan Wieck 已提交
365
DATA(insert OID = 1033 (  aclitem	 PGUID 8   -1 f b t \054 0 0 aclitemin aclitemout aclitemin aclitemout i p _null_ ));
366
DESCR("access control list");
367 368 369 370
DATA(insert OID = 1034 (  _aclitem	 PGUID -1 -1 f b t \054 0 1033 array_in array_out array_in array_out i x _null_ ));
DATA(insert OID = 1040 (  _macaddr	 PGUID -1 -1 f b t \054 0  829 array_in array_out array_in array_out i x _null_ ));
DATA(insert OID = 1041 (  _inet    PGUID -1 -1 f b t \054 0  869 array_in array_out array_in array_out i x _null_ ));
DATA(insert OID = 651  (  _cidr    PGUID -1 -1 f b t \054 0  650 array_in array_out array_in array_out i x _null_ ));
371
DATA(insert OID = 1042 ( bpchar		 PGUID -1  -1 f b t \054 0	0 bpcharin bpcharout bpcharin bpcharout i x _null_ ));
B
Bruce Momjian 已提交
372
DESCR("char(length), blank-padded string, fixed storage length");
373
#define BPCHAROID		1042
374
DATA(insert OID = 1043 ( varchar	 PGUID -1  -1 f b t \054 0	0 varcharin varcharout varcharin varcharout i x _null_ ));
B
Bruce Momjian 已提交
375
DESCR("varchar(length), non-blank-padded string, variable storage length");
376
#define VARCHAROID		1043
377

J
TOAST  
Jan Wieck 已提交
378
DATA(insert OID = 1082 ( date		 PGUID	4  10 t b t \054 0	0 date_in date_out date_in date_out i p _null_ ));
B
Bruce Momjian 已提交
379
DESCR("ANSI SQL date");
380
#define DATEOID			1082
J
TOAST  
Jan Wieck 已提交
381
DATA(insert OID = 1083 ( time		 PGUID	8  16 f b t \054 0	0 time_in time_out time_in time_out d p _null_ ));
B
Bruce Momjian 已提交
382
DESCR("hh:mm:ss, ANSI SQL time");
383
#define TIMEOID			1083
384 385

/* OIDS 1100 - 1199 */
386 387
DATA(insert OID = 1182 ( _date		 PGUID	-1 -1 f b t \054 0	1082 array_in array_out array_in array_out i x _null_ ));
DATA(insert OID = 1183 ( _time		 PGUID	-1 -1 f b t \054 0	1083 array_in array_out array_in array_out d x _null_ ));
J
TOAST  
Jan Wieck 已提交
388
DATA(insert OID = 1184 ( timestamp	 PGUID	8  47 f b t \054 0	0 timestamp_in timestamp_out timestamp_in timestamp_out d p _null_ ));
B
Bruce Momjian 已提交
389
DESCR("date and time");
390
#define TIMESTAMPOID	1184
391
DATA(insert OID = 1185 ( _timestamp  PGUID	-1 -1 f b t \054 0	1184 array_in array_out array_in array_out d x _null_ ));
J
TOAST  
Jan Wieck 已提交
392
DATA(insert OID = 1186 ( interval	 PGUID 12  47 f b t \054 0	0 interval_in interval_out interval_in interval_out d p _null_ ));
B
Bruce Momjian 已提交
393
DESCR("@ <number> <units>, time interval");
394
#define INTERVALOID		1186
395
DATA(insert OID = 1187 ( _interval	 PGUID	-1 -1 f b t \054 0	1186 array_in array_out array_in array_out d x _null_ ));
396 397

/* OIDS 1200 - 1299 */
398
DATA(insert OID = 1231 (  _numeric	 PGUID -1  -1 f b t \054 0	1700 array_in array_out array_in array_out i x _null_ ));
J
TOAST  
Jan Wieck 已提交
399
DATA(insert OID = 1266 ( timetz		 PGUID 12  22 f b t \054 0	0 timetz_in timetz_out timetz_in timetz_out d p _null_ ));
400 401
DESCR("hh:mm:ss, ANSI SQL time");
#define TIMETZOID		1266
402
DATA(insert OID = 1270 ( _timetz	 PGUID	-1 -1 f b t \054 0	1266 array_in array_out array_in array_out d x _null_ ));
403

404
/* OIDS 1500 - 1599 */
J
TOAST  
Jan Wieck 已提交
405
DATA(insert OID = 1560 ( bit		 PGUID -1  -1 f b t \054 0	0 zpbit_in zpbit_out zpbit_in zpbit_out i p _null_ ));
406
DESCR("fixed-length bit string");
407
#define ZPBITOID	 1560
408
DATA(insert OID = 1561 ( _bit		 PGUID	-1 -1 f b t \054 0	1560 array_in array_out array_in array_out i x _null_ ));
J
TOAST  
Jan Wieck 已提交
409
DATA(insert OID = 1562 ( varbit		 PGUID -1  -1 f b t \054 0	0 varbit_in varbit_out varbit_in varbit_out i p _null_ ));
410
DESCR("fixed-length bit string");
411
#define VARBITOID	  1562
412
DATA(insert OID = 1563 ( _varbit	 PGUID	-1 -1 f b t \054 0	1562 array_in array_out array_in array_out i x _null_ ));
413 414

/* OIDS 1600 - 1699 */
J
TOAST  
Jan Wieck 已提交
415
DATA(insert OID = 1625 ( lztext		 PGUID -1  -1 f b t \054 0	0 lztextin lztextout lztextin lztextout i x _null_ ));
416
DESCR("variable-length string, stored compressed");
417
#define LZTEXTOID	  1625
418

419
/* OIDS 1700 - 1799 */
420
DATA(insert OID = 1700 ( numeric	   PGUID -1  -1 f b t \054 0  0 numeric_in numeric_out numeric_in numeric_out i m _null_ ));
B
Bruce Momjian 已提交
421
DESCR("numeric(precision, decimal), arbitrary precision number");
422 423
#define NUMERICOID		1700

424
#define VARLENA_FIXED_SIZE(attr)	((attr)->atttypid == BPCHAROID && (attr)->atttypmod > 0)
425

426
/*
427
 * prototypes for functions in pg_type.c
428
 */
429
extern Oid	TypeGet(char *typeName, bool *defined);
430
extern Oid	TypeShellMake(char *typeName);
431
extern Oid TypeCreate(char *typeName,
432 433 434 435 436 437 438 439
		   Oid relationOid,
		   int16 internalSize,
		   int16 externalSize,
		   char typeType,
		   char typDelim,
		   char *inputProcedure,
		   char *outputProcedure,
		   char *receiveProcedure,
440
		   char *sendProcedure,
441 442
		   char *elementTypeName,
		   char *defaultTypeValue,
J
TOAST  
Jan Wieck 已提交
443 444
		   bool passedByValue, char alignment,
		   char storage);
445
extern void TypeRename(const char *oldTypeName, const char *newTypeName);
446
extern char *makeArrayTypeName(char *typeName);
447 448


449
#endif	 /* PG_TYPE_H */