3
* Description: See "pgtypes.c"
5
* Comments: See "notice.txt" for copyright and license information.
14
/* the type numbers are defined by the OID's of the types' rows */
15
/* in table pg_type */
19
#define PG_TYPE_LO ???? /* waiting for permanent type */
22
#define PG_TYPE_BOOL 16
23
#define PG_TYPE_BYTEA 17
24
#define PG_TYPE_CHAR 18
25
#define PG_TYPE_NAME 19
26
#define PG_TYPE_INT8 20
27
#define PG_TYPE_INT2 21
28
#define PG_TYPE_INT2VECTOR 22
29
#define PG_TYPE_INT4 23
30
#define PG_TYPE_REGPROC 24
31
#define PG_TYPE_TEXT 25
32
#define PG_TYPE_OID 26
33
#define PG_TYPE_TID 27
34
#define PG_TYPE_XID 28
35
#define PG_TYPE_CID 29
36
#define PG_TYPE_OIDVECTOR 30
37
#define PG_TYPE_SET 32
38
#define PG_TYPE_CHAR2 409
39
#define PG_TYPE_CHAR4 410
40
#define PG_TYPE_CHAR8 411
41
#define PG_TYPE_POINT 600
42
#define PG_TYPE_LSEG 601
43
#define PG_TYPE_PATH 602
44
#define PG_TYPE_BOX 603
45
#define PG_TYPE_POLYGON 604
46
#define PG_TYPE_FILENAME 605
47
#define PG_TYPE_FLOAT4 700
48
#define PG_TYPE_FLOAT8 701
49
#define PG_TYPE_ABSTIME 702
50
#define PG_TYPE_RELTIME 703
51
#define PG_TYPE_TINTERVAL 704
52
#define PG_TYPE_UNKNOWN 705
53
#define PG_TYPE_MONEY 790
54
#define PG_TYPE_OIDINT2 810
55
#define PG_TYPE_OIDINT4 910
56
#define PG_TYPE_OIDNAME 911
57
#define PG_TYPE_BPCHAR 1042
58
#define PG_TYPE_VARCHAR 1043
59
#define PG_TYPE_DATE 1082
60
#define PG_TYPE_TIME 1083
61
#define PG_TYPE_TIMESTAMP_NO_TMZONE 1114 /* since 7.2 */
62
#define PG_TYPE_DATETIME 1184
63
#define PG_TYPE_TIME_WITH_TMZONE 1266 /* since 7.1 */
64
#define PG_TYPE_TIMESTAMP 1296 /* deprecated since 7.0 */
65
#define PG_TYPE_NUMERIC 1700
66
#define INTERNAL_ASIS_TYPE (-9999)
68
/* extern Int4 pgtypes_defined[]; */
69
extern Int2 sqlTypes[];
71
/* Defines for pgtype_precision */
72
#define PG_STATIC (-1)
74
Int4 sqltype_to_pgtype(StatementClass *stmt, Int2 fSqlType);
76
Int2 pgtype_to_concise_type(StatementClass *stmt, Int4 type);
77
Int2 pgtype_to_sqldesctype(StatementClass *stmt, Int4 type);
78
Int2 pgtype_to_datetime_sub(StatementClass *stmt, Int4 type);
79
Int2 pgtype_to_ctype(StatementClass *stmt, Int4 type);
80
const char *pgtype_to_name(StatementClass *stmt, Int4 type);
82
/* These functions can use static numbers or result sets(col parameter) */
83
Int4 pgtype_column_size(StatementClass *stmt, Int4 type, int col, int handle_unknown_size_as); /* corresponds to "precision" in ODBC 2.x */
84
Int4 pgtype_precision(StatementClass *stmt, Int4 type, int col, int handle_unknown_size_as); /* "precsion in ODBC 3.x */
85
Int4 pgtype_display_size(StatementClass *stmt, Int4 type, int col, int handle_unknown_size_as);
86
Int4 pgtype_buffer_length(StatementClass *stmt, Int4 type, int col, int handle_unknown_size_as);
87
Int4 pgtype_desclength(StatementClass *stmt, Int4 type, int col, int handle_unknown_size_as);
88
Int4 pgtype_transfer_octet_length(StatementClass *stmt, Int4 type, int col, int handle_unknown_size_as);
90
Int2 pgtype_decimal_digits(StatementClass *stmt, Int4 type, int col); /* corresponds to "scale" in ODBC 2.x */
91
Int2 pgtype_scale(StatementClass *stmt, Int4 type, int col); /* ODBC 3.x " */
92
Int2 pgtype_radix(StatementClass *stmt, Int4 type);
93
Int2 pgtype_nullable(StatementClass *stmt, Int4 type);
94
Int2 pgtype_auto_increment(StatementClass *stmt, Int4 type);
95
Int2 pgtype_case_sensitive(StatementClass *stmt, Int4 type);
96
Int2 pgtype_money(StatementClass *stmt, Int4 type);
97
Int2 pgtype_searchable(StatementClass *stmt, Int4 type);
98
Int2 pgtype_unsigned(StatementClass *stmt, Int4 type);
99
char *pgtype_literal_prefix(StatementClass *stmt, Int4 type);
100
char *pgtype_literal_suffix(StatementClass *stmt, Int4 type);
101
char *pgtype_create_params(StatementClass *stmt, Int4 type);
103
Int2 sqltype_to_default_ctype(const ConnectionClass *stmt, Int2 sqltype);
104
Int4 ctype_length(Int2 ctype);
106
#define USE_ZONE FALSE