source: trunk/pgtypes.h

Last change on this file was 798, checked in by cito, 3 years ago

Port type cache and typecasting from pgdb to pg

So far, the typecasting in the classic module was been only done by
the C extension module and was not extensible through typecasting
functions in Python. This has now been made extensible by adding
a cast hook to the C extension module which has been hooked up to
a new type cache object that holds information on the types and the
associated typecast functions. All of this works very similar to the
pgdb module now, except that the basic types are still handled by
the C extension module and the Python typecast functions are only
called via the hook for types which are not supported internally.

Also added tests and a chapter on the type cache in the documentation,
and cleaned up the error messages in the C extension module.

File size: 3.0 KB
Line 
1/*
2        pgtypes - PostgreSQL type definitions
3
4        These are the standard PostgreSQL 9.5 built-in types,
5        extracted from src/include/catalog/pg_type.h,
6        because that header file is sometimes not available
7        or needs other header files to get properly included.
8        You can also query pg_type to get this information.
9*/
10
11#ifndef PG_TYPE_H
12
13#define BOOLOID 16
14#define BYTEAOID 17
15#define CHAROID 18
16#define NAMEOID 19
17#define INT8OID 20
18#define INT2OID 21
19#define INT2VECTOROID 22
20#define INT4OID 23
21#define REGPROCOID 24
22#define TEXTOID 25
23#define OIDOID 26
24#define TIDOID 27
25#define XIDOID 28
26#define CIDOID 29
27#define OIDVECTOROID 30
28#define JSONOID 114
29#define XMLOID 142
30#define PGNODETREEOID 194
31#define PGDDLCOMMANDOID 32
32#define POINTOID 600
33#define LSEGOID 601
34#define PATHOID 602
35#define BOXOID 603
36#define POLYGONOID 604
37#define LINEOID 628
38#define FLOAT4OID 700
39#define FLOAT8OID 701
40#define ABSTIMEOID 702
41#define RELTIMEOID 703
42#define TINTERVALOID 704
43#define UNKNOWNOID 705
44#define CIRCLEOID 718
45#define CASHOID 790
46#define MACADDROID 829
47#define INETOID 869
48#define CIDROID 650
49#define INT2ARRAYOID 1005
50#define INT4ARRAYOID 1007
51#define TEXTARRAYOID 1009
52#define OIDARRAYOID 1028
53#define FLOAT4ARRAYOID 1021
54#define ACLITEMOID 1033
55#define CSTRINGARRAYOID 1263
56#define BPCHAROID 1042
57#define VARCHAROID 1043
58#define DATEOID 1082
59#define TIMEOID 1083
60#define TIMESTAMPOID 1114
61#define TIMESTAMPTZOID 1184
62#define INTERVALOID 1186
63#define TIMETZOID 1266
64#define BITOID 1560
65#define VARBITOID 1562
66#define NUMERICOID 1700
67#define REFCURSOROID 1790
68#define REGPROCEDUREOID 2202
69#define REGOPEROID 2203
70#define REGOPERATOROID 2204
71#define REGCLASSOID 2205
72#define REGTYPEOID 2206
73#define REGROLEOID 4096
74#define REGNAMESPACEOID 4089
75#define REGTYPEARRAYOID 2211
76#define UUIDOID 2950
77#define LSNOID 3220
78#define TSVECTOROID 3614
79#define GTSVECTOROID 3642
80#define TSQUERYOID 3615
81#define REGCONFIGOID 3734
82#define REGDICTIONARYOID 3769
83#define JSONBOID 3802
84#define INT4RANGEOID 3904
85#define RECORDOID 2249
86#define RECORDARRAYOID 2287
87#define CSTRINGOID 2275
88#define ANYOID 2276
89#define ANYARRAYOID 2277
90#define VOIDOID 2278
91#define TRIGGEROID 2279
92#define EVTTRIGGEROID 3838
93#define LANGUAGE_HANDLEROID 2280
94#define INTERNALOID 2281
95#define OPAQUEOID 2282
96#define ANYELEMENTOID 2283
97#define ANYNONARRAYOID 2776
98#define ANYENUMOID 3500
99#define FDW_HANDLEROID 3115
100#define TSM_HANDLEROID 3310
101#define ANYRANGEOID 3831
102
103/* more types */
104
105#define JSONARRAYOID 199
106#define CASHARRAYOID 791
107#define BOOLARRAYOID 1000
108#define BYTEAARRAYOID 1001
109#define CHARARRAYOID 1002
110#define NAMEARRAYOID 1003
111#define XIDARRAYOID 1011
112#define CIDARRAYOID 1012
113#define BPCHARARRAYOID 1014
114#define VARCHARARRAYOID 1015
115#define INT8ARRAYOID 1016
116#define FLOAT8ARRAYOID 1022
117#define ABSTIMEARRAYOID 1023
118#define RELTIMEARRAYOID 1024
119#define TIMESTAMPARRAYOID 1115
120#define DATEARRAYOID 1182
121#define TIMEARRAYOID 1183
122#define TIMESTAMPTZARRAYOID 1185
123#define INTERVALARRAYOID 1187
124#define NUMERICARRAYOID 1231
125#define TIMETZARRAYOID 1270
126#define JSONBARRAYOID 3807
127
128#endif /* PG_TYPE_H */
Note: See TracBrowser for help on using the repository browser.