~ubuntu-branches/ubuntu/lucid/psqlodbc/lucid

« back to all changes in this revision

Viewing changes to pgtypes.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2004-05-13 10:47:36 UTC
  • Revision ID: james.westby@ubuntu.com-20040513104736-a530gmn0p3knep89
Tags: upstream-07.03.0200
ImportĀ upstreamĀ versionĀ 07.03.0200

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* File:                        pgtypes.h
 
2
 *
 
3
 * Description:         See "pgtypes.c"
 
4
 *
 
5
 * Comments:            See "notice.txt" for copyright and license information.
 
6
 *
 
7
 */
 
8
 
 
9
#ifndef __PGTYPES_H__
 
10
#define __PGTYPES_H__
 
11
 
 
12
#include "psqlodbc.h"
 
13
 
 
14
/* the type numbers are defined by the OID's of the types' rows */
 
15
/* in table pg_type */
 
16
 
 
17
 
 
18
#if 0
 
19
#define PG_TYPE_LO                              ????    /* waiting for permanent type */
 
20
#endif
 
21
 
 
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)
 
67
 
 
68
/* extern Int4 pgtypes_defined[]; */
 
69
extern Int2 sqlTypes[];
 
70
 
 
71
/*      Defines for pgtype_precision */
 
72
#define PG_STATIC                               (-1)
 
73
 
 
74
Int4            sqltype_to_pgtype(StatementClass *stmt, Int2 fSqlType);
 
75
 
 
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);
 
81
 
 
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);
 
89
 
 
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);
 
102
 
 
103
Int2            sqltype_to_default_ctype(const ConnectionClass *stmt, Int2 sqltype);
 
104
Int4            ctype_length(Int2 ctype);
 
105
 
 
106
#define USE_ZONE        FALSE
 
107
#endif