[PATCH] Patch: Use Oid from libpq instead of define a new OID type

Поиск
Список
Период
Сортировка
От caspian
Тема [PATCH] Patch: Use Oid from libpq instead of define a new OID type
Дата
Msg-id 20221011145513.24919-1-caspian46@gmail.com
обсуждение исходный текст
Список pgsql-odbc
Hello, psqlODBC team!
Since pgodbc uses libpq which has defined Oid, we should use it.
If libpq changed it's definition, no code changed need to be made.

Signed-off-by: caspian <caspian46@gmail.com>
---
 bind.c                             |   2 +-
 bind.h                             |   4 +-
 columninfo.c                       |   6 +-
 columninfo.h                       |   8 +--
 connection.c                       |   2 +-
 connection.h                       |   2 +-
 convert.c                          |  26 ++++----
 convert.h                          |   6 +-
 descriptor.c                       |   4 +-
 descriptor.h                       |  16 ++---
 dlg_wingui.c                       |   2 +-
 execute.c                          |   2 +-
 info.c                             |  12 ++--
 lobj.c                             |   4 +-
 lobj.h                             |   2 +-
 parse.c                            |  34 +++++-----
 pgapifunc.h                        |   4 +-
 pgtypes.c                          | 100 ++++++++++++++---------------
 pgtypes.h                          |  80 +++++++++++------------
 psqlodbc.h                         |   3 +-
 qresult.c                          |   4 +-
 results.c                          |  34 +++++-----
 statement.c                        |   2 +-
 test/src/catalogfunctions-test.c   |   2 +-
 test/src/result-conversions-test.c |   2 +-
 tuple.h                            |   4 +-
 26 files changed, 184 insertions(+), 183 deletions(-)

diff --git a/bind.c b/bind.c
index ecddea8..71908f4 100644
--- a/bind.c
+++ b/bind.c
@@ -311,7 +311,7 @@ PGAPI_DescribeParam(HSTMT hstmt,
     IPDFields    *ipdopts;
     RETCODE        ret = SQL_SUCCESS;
     int        num_params;
-    OID        pgtype;
+    Oid        pgtype;
     ConnectionClass    *conn;
 
     MYLOG(0, "entering...%d\n", ipar);
diff --git a/bind.h b/bind.h
index 00b6070..901a443 100644
--- a/bind.h
+++ b/bind.h
@@ -67,7 +67,7 @@ typedef struct
 {
     SQLLEN    *EXEC_used;    /* amount of data */
     char    *EXEC_buffer;     /* the data */
-    OID    lobj_oid;
+    Oid    lobj_oid;
 }    PutDataClass;
 
 /*
@@ -78,7 +78,7 @@ struct ParameterImplClass_
     pgNAME        paramName;    /* this is unavailable even in 8.1 */
     SQLSMALLINT    paramType;
     SQLSMALLINT    SQLType;
-    OID        PGType;
+    Oid        PGType;
     SQLULEN        column_size;
     SQLSMALLINT    decimal_digits;
     SQLSMALLINT    precision;    /* the precision for numeric or timestamp type */
diff --git a/columninfo.c b/columninfo.c
index 60bd89c..792d83c 100644
--- a/columninfo.c
+++ b/columninfo.c
@@ -58,7 +58,7 @@ CI_read_fields_from_pgres(ColumnInfoClass *self, PGresult *pgres)
 {
     Int2        lf;
     int            new_num_fields;
-    OID        new_adtid, new_relid = 0, new_attid = 0;
+    Oid        new_adtid, new_relid = 0, new_attid = 0;
     Int2        new_adtsize;
     Int4        new_atttypmod = -1;
     char       *new_field_name;
@@ -149,8 +149,8 @@ CI_set_num_fields(ColumnInfoClass *self, int new_num_fields)
 
 void
 CI_set_field_info(ColumnInfoClass *self, int field_num, char *new_name,
-        OID new_adtid, Int2 new_adtsize, Int4 new_atttypmod,
-        OID new_relid, OID new_attid)
+        Oid new_adtid, Int2 new_adtsize, Int4 new_atttypmod,
+        Oid new_relid, Oid new_attid)
 {
     /* check bounds */
     if ((field_num < 0) || (field_num >= self->num_fields))
diff --git a/columninfo.h b/columninfo.h
index 0b46634..99ae504 100644
--- a/columninfo.h
+++ b/columninfo.h
@@ -21,11 +21,11 @@ struct ColumnInfoClass_
     struct srvr_info
     {
         char    *name;        /* field name */
-        OID    adtid;        /* type oid */
+        Oid    adtid;        /* type oid */
         Int2    adtsize;    /* type size */
         Int4    display_size;    /* the display size (longest row) */
         Int4    atttypmod;    /* the length of bpchar/varchar */
-        OID    relid;        /* the relation id */
+        Oid    relid;        /* the relation id */
         Int2    attid;        /* the attribute number */
     }    *coli_array;
 };
@@ -48,7 +48,7 @@ BOOL        CI_read_fields_from_pgres(ColumnInfoClass *self, PGresult *pgres);
 /* without reading from a socket */
 void        CI_set_num_fields(ColumnInfoClass *self, int new_num_fields);
 void CI_set_field_info(ColumnInfoClass *self, int field_num, char *new_name,
-        OID new_adtid, Int2 new_adtsize, Int4 atttypmod,
-        OID new_relid, OID new_attid);
+        Oid new_adtid, Int2 new_adtsize, Int4 atttypmod,
+        Oid new_relid, Oid new_attid);
 
 #endif
diff --git a/connection.c b/connection.c
index abd8b07..04169a8 100644
--- a/connection.c
+++ b/connection.c
@@ -2574,7 +2574,7 @@ CC_lookup_lo(ConnectionClass *self)
         ret = SQL_ERROR;
     else if (QR_command_maybe_successful(res) && QR_get_num_cached_tuples(res) > 0)
     {
-        OID    basetype;
+        Oid    basetype;
 
         self->lobj_type = QR_get_value_backend_int(res, 0, 0, NULL);
         basetype = QR_get_value_backend_int(res, 0, 1, NULL);
diff --git a/connection.h b/connection.h
index a002694..448ae50 100644
--- a/connection.h
+++ b/connection.h
@@ -237,7 +237,7 @@ struct col_info
     QResultClass    *result;
     pgNAME        schema_name;
     pgNAME        table_name;
-    OID        table_oid;
+    Oid        table_oid;
     int        table_info;
     time_t        acc_time;
 };
diff --git a/convert.c b/convert.c
index ce0ee46..ba625e5 100644
--- a/convert.c
+++ b/convert.c
@@ -772,7 +772,7 @@ static void set_client_decimal_point(char *num, BOOL) {}
 
 /*    This is called by SQLFetch() */
 int
-copy_and_convert_field_bindinfo(StatementClass *stmt, OID field_type, int atttypmod, void *value, int col)
+copy_and_convert_field_bindinfo(StatementClass *stmt, Oid field_type, int atttypmod, void *value, int col)
 {
     ARDFields *opts = SC_get_ARDF(stmt);
     BindInfoClass *bic;
@@ -916,7 +916,7 @@ get_adjust_len(SQLSMALLINT fCType, SQLLEN len)
 static int
 setup_getdataclass(SQLLEN * const length_return, const char ** const ptr_return,
     int *needbuflen_return, GetDataClass * const pgdc, const char *neut_str,
-    const OID field_type, const SQLSMALLINT fCType,
+    const Oid field_type, const SQLSMALLINT fCType,
     const SQLLEN cbValueMax, const ConnectionClass * const conn)
 {
     SQLLEN len = (-2);
@@ -1127,7 +1127,7 @@ cleanup:
  */
 static int
 convert_text_field_to_sql_c(GetDataInfo * const gdata, const int current_col,
-    const char * const neut_str, const OID field_type,
+    const char * const neut_str, const Oid field_type,
     const SQLSMALLINT fCType, char * const rgbValueBindRow,
     const SQLLEN cbValueMax, const ConnectionClass * const conn,
     SQLLEN * const length_return)
@@ -1244,7 +1244,7 @@ cleanup:
 /*    This is called by SQLGetData() */
 int
 copy_and_convert_field(StatementClass *stmt,
-        OID field_type, int atttypmod,
+        Oid field_type, int atttypmod,
         void *valuei,
         SQLSMALLINT fCType, int precision,
         PTR rgbValue, SQLLEN cbValueMax,
@@ -1564,7 +1564,7 @@ MYLOG(DETAIL_LOG_LEVEL, "2stime fr=%d\n", std_time.fr);
             break;
 
             /*
-             * This is a large object OID, which is used to store
+             * This is a large object Oid, which is used to store
              * LONGVARBINARY objects.
              */
         case PG_TYPE_LO_UNDEFINED:
@@ -4010,7 +4010,7 @@ cleanup:
 BOOL
 build_libpq_bind_params(StatementClass *stmt,
                         int *nParams,
-                        OID **paramTypes,
+                        Oid **paramTypes,
                         char ***paramValues,
                         int **paramLengths,
                         int **paramFormats,
@@ -4054,7 +4054,7 @@ build_libpq_bind_params(StatementClass *stmt,
 
     if (num_params > 0)
     {
-        *paramTypes = malloc(sizeof(OID) * num_params);
+        *paramTypes = malloc(sizeof(Oid) * num_params);
         if (*paramTypes == NULL)
             goto cleanup;
         *paramValues = malloc(sizeof(char *) * num_params);
@@ -4084,7 +4084,7 @@ MYLOG(DETAIL_LOG_LEVEL, "num_p=%d\n", num_p);
         BOOL    isnull;
         BOOL    isbinary;
         char    *val_copy;
-        OID    pgType;
+        Oid    pgType;
 
         /*
          * Now build the parameter values.
@@ -4435,12 +4435,12 @@ handle_lu_onvert_error(QueryBuild *qb, int flag, char *buffer, SQLLEN paralen)
  * *isnull is set to TRUE if it was NULL.
  * *isbinary is set to TRUE, if the binary output format was used. (binary
  *   output is only produced if the FLGB_BINARY_AS_POSSIBLE flag is set)
- * *pgType is set to the PostgreSQL type OID that should be used when binding
+ * *pgType is set to the PostgreSQL type Oid that should be used when binding
  * (or 0, to let the server decide)
  */
 static int
 ResolveOneParam(QueryBuild *qb, QueryParse *qp, BOOL *isnull, BOOL *isbinary,
-                OID *pgType)
+                Oid *pgType)
 {
     ConnectionClass *conn = qb->conn;
     const APDFields *apdopts = qb->apdopts;
@@ -4451,7 +4451,7 @@ ResolveOneParam(QueryBuild *qb, QueryParse *qp, BOOL *isnull, BOOL *isbinary,
     char        param_string[150],
                 tmp[256];
     char        cbuf[PG_NUMERIC_MAX_PRECISION * 2]; /* seems big enough to handle the data in this function */
-    OID            param_pgtype;
+    Oid            param_pgtype;
     SQLSMALLINT    param_ctype, param_sqltype;
     SIMPLE_TIME    st;
     struct tm    *tim;
@@ -4459,7 +4459,7 @@ ResolveOneParam(QueryBuild *qb, QueryParse *qp, BOOL *isnull, BOOL *isbinary,
     const char    *send_buf;
 
     char        *buffer, *allocbuf = NULL, *lastadd = NULL;
-    OID            lobj_oid;
+    Oid            lobj_oid;
     int            lobj_fd;
     SQLULEN        offset = apdopts->param_offset_ptr ? *apdopts->param_offset_ptr : 0;
     size_t        current_row = qb->current_row;
@@ -6360,7 +6360,7 @@ convert_lo(StatementClass *stmt, const void *value, SQLSMALLINT fCType, PTR rgbV
            SQLLEN cbValueMax, SQLLEN *pcbValue)
 {
     CSTR    func = "convert_lo";
-    OID            oid;
+    Oid            oid;
     int            result;
     Int8            retval;
     Int8        left64 = -1;
diff --git a/convert.h b/convert.h
index dec0769..934f629 100644
--- a/convert.h
+++ b/convert.h
@@ -23,9 +23,9 @@ extern "C" {
 #define COPY_NO_DATA_FOUND                        5
 #define COPY_INVALID_STRING_CONVERSION                6
 
-int    copy_and_convert_field_bindinfo(StatementClass *stmt, OID field_type, int atttypmod, void *value, int col);
+int    copy_and_convert_field_bindinfo(StatementClass *stmt, Oid field_type, int atttypmod, void *value, int col);
 int    copy_and_convert_field(StatementClass *stmt,
-            OID field_type, int atttypmod,
+            Oid field_type, int atttypmod,
             void *value,
             SQLSMALLINT fCType, int precision,
             PTR rgbValue, SQLLEN cbValueMax, SQLLEN *pcbValue, SQLLEN *pIndicator);
@@ -35,7 +35,7 @@ SQLLEN        pg_hex2bin(const char *in, char *out, SQLLEN len);
 size_t        findTag(const char *str, int ccsc);
 
 BOOL build_libpq_bind_params(StatementClass *stmt,
-                        int *nParams, OID **paramTypes,
+                        int *nParams, Oid **paramTypes,
                         char ***paramValues,
                         int **paramLengths,
                         int **paramFormats,
diff --git a/descriptor.c b/descriptor.c
index 407c1d6..81195dd 100644
--- a/descriptor.c
+++ b/descriptor.c
@@ -127,7 +127,7 @@ void    TI_Destroy_IH(TABLE_INFO *ti)
     ti->ih = NULL;
 }
 
-const pgNAME    TI_From_IH(TABLE_INFO *ti, OID tableoid)
+const pgNAME    TI_From_IH(TABLE_INFO *ti, Oid tableoid)
 {
     InheritanceClass    *ih;
     int            i;
@@ -148,7 +148,7 @@ const pgNAME    TI_From_IH(TABLE_INFO *ti, OID tableoid)
     return invNAME;
 }
 
-const pgNAME    TI_Ins_IH(TABLE_INFO *ti, OID tableoid, const char *fullName)
+const pgNAME    TI_Ins_IH(TABLE_INFO *ti, Oid tableoid, const char *fullName)
 {
     InheritanceClass    *ih;
     int            count;
diff --git a/descriptor.h b/descriptor.h
index 4729d93..a60e0d3 100644
--- a/descriptor.h
+++ b/descriptor.h
@@ -15,10 +15,10 @@ typedef struct InheritanceClass
 {
     UInt4    allocated;
     UInt4    count;
-    OID    cur_tableoid;
+    Oid    cur_tableoid;
     pgNAME    cur_fullTable;
     struct {
-        OID    tableoid;
+        Oid    tableoid;
         pgNAME    fullTable;
     } inf[1];
 } InheritanceClass;
@@ -32,7 +32,7 @@ enum {
 };
 typedef struct
 {
-    OID        table_oid;
+    Oid        table_oid;
     COL_INFO    *col_info; /* cached SQLColumns info for this table */
     pgNAME        schema_name;
     pgNAME        table_name;
@@ -57,8 +57,8 @@ void    TI_Constructor(TABLE_INFO *, const ConnectionClass *);
 void    TI_Destructor(TABLE_INFO **, int);
 void    TI_Create_IH(TABLE_INFO *ti);
 void    TI_Destroy_IH(TABLE_INFO *ti);
-const pgNAME    TI_From_IH(TABLE_INFO *ti, OID tableoid);
-const pgNAME    TI_Ins_IH(TABLE_INFO *ti, OID tableoid, const char *fullName);
+const pgNAME    TI_From_IH(TABLE_INFO *ti, Oid tableoid);
+const pgNAME    TI_Ins_IH(TABLE_INFO *ti, Oid tableoid, const char *fullName);
 
 enum {
     FIELD_INITIALIZED     = 0
@@ -85,8 +85,8 @@ typedef struct
     int        decimal_digits; /* scale in 2.x */
     int        display_size;
     SQLLEN        length;
-    OID        columntype;
-    OID        basetype; /* may be the basetype when the column type is a domain */
+    Oid        columntype;
+    Oid        basetype; /* may be the basetype when the column type is a domain */
     int        typmod;
     char        expr;
     char        quote;
@@ -212,7 +212,7 @@ BindInfoClass    *ARD_AllocBookmark(ARDFields *self);
 void    ARD_unbind_cols(ARDFields *self, BOOL freeall);
 void    APD_free_params(APDFields *self, char option);
 void    IPD_free_params(IPDFields *self, char option);
-BOOL    getCOLIfromTI(const char *, ConnectionClass *, StatementClass *, const OID, TABLE_INFO **);
+BOOL    getCOLIfromTI(const char *, ConnectionClass *, StatementClass *, const Oid, TABLE_INFO **);
 RETCODE    DC_set_stmt(DescriptorClass *desc, StatementClass *stmt);
 void    DC_clear_error(DescriptorClass *desc);
 void    DC_set_error(DescriptorClass *desc, int errornumber, const char * errormsg);
diff --git a/dlg_wingui.c b/dlg_wingui.c
index 471ccd0..059a31e 100644
--- a/dlg_wingui.c
+++ b/dlg_wingui.c
@@ -568,7 +568,7 @@ ds_options_update(HWND hdlg, ConnInfo *ci)
     ci->bytea_as_longvarbinary = IsDlgButtonChecked(hdlg, DS_BYTEAASLONGVARBINARY);
     /*ci->lower_case_identifier = IsDlgButtonChecked(hdlg, DS_LOWERCASEIDENTIFIER);*/
 
-    /* OID Options */
+    /* Oid Options */
     ITOA_FIXED(ci->fake_oid_index, IsDlgButtonChecked(hdlg, DS_FAKEOIDINDEX));
     ITOA_FIXED(ci->show_oid_column, IsDlgButtonChecked(hdlg, DS_SHOWOIDCOLUMN));
 
diff --git a/execute.c b/execute.c
index 25985fa..7b86f74 100644
--- a/execute.c
+++ b/execute.c
@@ -327,7 +327,7 @@ int HowToPrepareBeforeExec(StatementClass *stmt, BOOL checkOnly)
         int    param_number = -1;
         ParameterInfoClass *apara;
         ParameterImplClass *ipara;
-        OID    pgtype;
+        Oid    pgtype;
 
         while (TRUE)
         {
diff --git a/info.c b/info.c
index f190321..1cca662 100644
--- a/info.c
+++ b/info.c
@@ -2201,7 +2201,7 @@ cleanup:
  *    for oid or xmin
  */
 static void
-add_tuple_for_oid_or_xmin(TupleField *tuple, int ordinal, const char *colname, OID the_type, const char *typname,
constConnectionClass *conn, const char *table_owner, const char *table_name, OID greloid, int attnum, BOOL
auto_increment,int table_info)
 
+add_tuple_for_oid_or_xmin(TupleField *tuple, int ordinal, const char *colname, Oid the_type, const char *typname,
constConnectionClass *conn, const char *table_owner, const char *table_name, Oid greloid, int attnum, BOOL
auto_increment,int table_info)
 
 {
     int    sqltype;
     const int atttypmod = -1;
@@ -2248,7 +2248,7 @@ PGAPI_Columns(HSTMT hstmt,
               const SQLCHAR * szColumnName, /* PV E*/
               SQLSMALLINT cbColumnName,
               UWORD    flag,
-              OID    reloid,
+              Oid    reloid,
               Int2    attnum)
 {
     CSTR func = "PGAPI_Columns";
@@ -2267,7 +2267,7 @@ PGAPI_Columns(HSTMT hstmt,
     Int4        mod_length,
                 ordinal,
                 typmod, relhasoids, relhassubclass;
-    OID        field_type, greloid, basetype;
+    Oid        field_type, greloid, basetype;
     char        not_null[MAX_INFO_STRING],
                 relhasrules[MAX_INFO_STRING], relkind[8], attidentity[2];
     char    *escSchemaName = NULL, *escTableName = NULL, *escColumnName = NULL;
@@ -3099,7 +3099,7 @@ PGAPI_Statistics(HSTMT hstmt,
     SQLSMALLINT    internal_asis_type = SQL_C_CHAR, cbSchemaName, field_number;
     const SQLCHAR *szSchemaName;
     const char *eq_string;
-    OID        ioid;
+    Oid        ioid;
     Int4        relhasoids;
 
     MYLOG(0, "entering...stmt=%p scnm=%p len=%d\n", stmt, szTableOwner, cbTableOwner);
@@ -3658,7 +3658,7 @@ PGAPI_PrimaryKeys(HSTMT hstmt,
                   SQLSMALLINT cbTableOwner,
                   const SQLCHAR * szTableName, /* OA(R) E*/
                   SQLSMALLINT cbTableName,
-                  OID    reloid)
+                  Oid    reloid)
 {
     CSTR func = "PGAPI_PrimaryKeys";
     StatementClass *stmt = (StatementClass *) hstmt;
@@ -4916,7 +4916,7 @@ PGAPI_ProcedureColumns(HSTMT hstmt,
     char        *atttypid, *attname, *column_name;
     QResultClass *res, *tres = NULL;
     SQLLEN        tcount;
-    OID            pgtype;
+    Oid            pgtype;
     Int4        paramcount, column_size, i, j;
     RETCODE        ret = SQL_ERROR, result;
     BOOL        search_pattern, bRetset, outpara_exist;
diff --git a/lobj.c b/lobj.c
index 7dfd943..82e282f 100644
--- a/lobj.c
+++ b/lobj.c
@@ -17,7 +17,7 @@
 #include "connection.h"
 
 
-OID
+Oid
 odbc_lo_creat(ConnectionClass *conn, int mode)
 {
     LO_ARG        argv[1];
@@ -30,7 +30,7 @@ odbc_lo_creat(ConnectionClass *conn, int mode)
     if (!CC_send_function(conn, "lo_creat", &retval, &result_len, 1, argv, 1))
         return 0;                /* invalid oid */
     else
-        return (OID) retval;
+        return (Oid) retval;
 }
 
 
diff --git a/lobj.h b/lobj.h
index 1428c52..bea5d9e 100644
--- a/lobj.h
+++ b/lobj.h
@@ -27,7 +27,7 @@ struct lo_arg
 #define INV_WRITE                    0x00020000
 #define INV_READ                    0x00040000
 
-OID        odbc_lo_creat(ConnectionClass *conn, int mode);
+Oid        odbc_lo_creat(ConnectionClass *conn, int mode);
 int        odbc_lo_open(ConnectionClass *conn, int lobjId, int mode);
 int        odbc_lo_close(ConnectionClass *conn, int fd);
 Int4        odbc_lo_read(ConnectionClass *conn, int fd, char *buf, Int4 len);
diff --git a/parse.c b/parse.c
index b0d751f..ca1084d 100644
--- a/parse.c
+++ b/parse.c
@@ -46,11 +46,11 @@
 static const char *getNextToken(int ccsc, char escape_in_literal, const char *s, char *token, int smax, char *delim,
char*quote, char *dquote, char *numeric);
 
 static    void    getColInfo(COL_INFO *col_info, FIELD_INFO *fi, int k);
 static    char    searchColInfo(COL_INFO *col_info, FIELD_INFO *fi);
-static    BOOL    getColumnsInfo(ConnectionClass *, TABLE_INFO *, OID, StatementClass *);
+static    BOOL    getColumnsInfo(ConnectionClass *, TABLE_INFO *, Oid, StatementClass *);
 
 Int4 FI_precision(const FIELD_INFO *fi)
 {
-    OID    ftype;
+    Oid    ftype;
 
     if (!fi)    return -1;
     ftype = FI_type(fi);
@@ -66,7 +66,7 @@ Int4 FI_precision(const FIELD_INFO *fi)
 }
 Int4 FI_scale(const FIELD_INFO *fi)
 {
-    OID    ftype;
+    Oid    ftype;
 
     if (!fi)    return -1;
     ftype = FI_type(fi);
@@ -292,7 +292,7 @@ MYLOG(DETAIL_LOG_LEVEL, "entering non-manual result\n");
     fi->dquote = TRUE;
     STR_TO_NAME(fi->column_name, QR_get_value_backend_text(col_info->result, k, COLUMNS_COLUMN_NAME));
 
-    fi->columntype = (OID) QR_get_value_backend_int(col_info->result, k, COLUMNS_FIELD_TYPE, NULL);
+    fi->columntype = (Oid) QR_get_value_backend_int(col_info->result, k, COLUMNS_FIELD_TYPE, NULL);
     fi->column_size = QR_get_value_backend_int(col_info->result, k, COLUMNS_PRECISION, NULL);
     fi->length = QR_get_value_backend_int(col_info->result, k, COLUMNS_LENGTH, NULL);
     if (str = QR_get_value_backend_text(col_info->result, k, COLUMNS_SCALE), str)
@@ -310,7 +310,7 @@ searchColInfo(COL_INFO *col_info, FIELD_INFO *fi)
 {
     int            k,
                 cmp, attnum, atttypmod;
-    OID            basetype;
+    Oid            basetype;
     const char       *col;
 
 MYLOG(DETAIL_LOG_LEVEL, "entering num_cols=" FORMAT_ULEN " col=%s\n", QR_get_num_cached_tuples(col_info->result),
PRINT_NAME(fi->column_name));
@@ -321,8 +321,8 @@ MYLOG(DETAIL_LOG_LEVEL, "entering num_cols=" FORMAT_ULEN " col=%s\n", QR_get_num
         if (fi->attnum > 0)
         {
             attnum = QR_get_value_backend_int(col_info->result, k, COLUMNS_PHYSICAL_NUMBER, NULL);
-            if (basetype = (OID) strtoul(QR_get_value_backend_text(col_info->result, k, COLUMNS_BASE_TYPEID), NULL,
10),0 == basetype)
 
-                basetype = (OID) strtoul(QR_get_value_backend_text(col_info->result, k, COLUMNS_FIELD_TYPE), NULL,
10);
+            if (basetype = (Oid) strtoul(QR_get_value_backend_text(col_info->result, k, COLUMNS_BASE_TYPEID), NULL,
10),0 == basetype)
 
+                basetype = (Oid) strtoul(QR_get_value_backend_text(col_info->result, k, COLUMNS_FIELD_TYPE), NULL,
10);
             atttypmod = QR_get_value_backend_int(col_info->result, k, COLUMNS_ATTTYPMOD, NULL);
 MYLOG(DETAIL_LOG_LEVEL, "%d attnum=%d\n", k, attnum);
             if (attnum == fi->attnum &&
@@ -619,7 +619,7 @@ MYLOG(DETAIL_LOG_LEVEL, "entering ntab=%d", stmt->ntab);
     else if (res = SC_get_Curres(stmt), NULL != res)
     {
         int    i, num_fields = QR_NumPublicResultCols(res);
-        OID    reloid = 0, greloid;
+        Oid    reloid = 0, greloid;
 
         for (i = 0; i < num_fields; i++)
         {
@@ -651,7 +651,7 @@ ColAttSet(StatementClass *stmt, TABLE_INFO *rti)
     IRDFields    *irdflds = SC_get_IRDF(stmt);
     COL_INFO    *col_info = NULL;
     FIELD_INFO    **fi, *wfi;
-    OID        reloid = 0;
+    Oid        reloid = 0;
     Int2        attid;
     int        i, num_fields;
     BOOL        fi_reuse, updatable, call_xxxxx;
@@ -689,7 +689,7 @@ MYPRINTF(0, "->%d\n", updatable);
         SC_set_updatable(stmt, updatable);
     for (i = 0; i < num_fields; i++)
     {
-        if (reloid == (OID) QR_get_relid(res, i))
+        if (reloid == (Oid) QR_get_relid(res, i))
         {
             if (wfi = fi[i], NULL == wfi)
             {
@@ -821,7 +821,7 @@ COL_INFO **coli)
 }
 
 static BOOL
-getColumnsInfo(ConnectionClass *conn, TABLE_INFO *wti, OID greloid, StatementClass *stmt)
+getColumnsInfo(ConnectionClass *conn, TABLE_INFO *wti, Oid greloid, StatementClass *stmt)
 {
     BOOL        found = FALSE;
     RETCODE        result;
@@ -953,7 +953,7 @@ getColumnsInfo(ConnectionClass *conn, TABLE_INFO *wti, OID greloid, StatementCla
             int i;
 
             if (!greloid)
-                greloid = (OID) strtoul(QR_get_value_backend_text(res, 0, COLUMNS_TABLE_OID), NULL, 10);
+                greloid = (Oid) strtoul(QR_get_value_backend_text(res, 0, COLUMNS_TABLE_OID), NULL, 10);
             if (!wti->table_oid)
                 wti->table_oid = greloid;
             if (NAME_IS_NULL(wti->schema_name))
@@ -1009,10 +1009,10 @@ cleanup:
     return found;
 }
 
-BOOL getCOLIfromTI(const char *func, ConnectionClass *conn, StatementClass *stmt, const OID reloid, TABLE_INFO **pti)
+BOOL getCOLIfromTI(const char *func, ConnectionClass *conn, StatementClass *stmt, const Oid reloid, TABLE_INFO **pti)
 {
     BOOL    colatt = FALSE, found = FALSE;
-    OID    greloid = reloid;
+    Oid    greloid = reloid;
     TABLE_INFO    *wti = *pti;
     COL_INFO    *coli;
 
@@ -1101,7 +1101,7 @@ cleanup:
         if (res && QR_get_num_cached_tuples(res) > 0)
         {
             if (!greloid)
-                greloid = (OID) strtoul(QR_get_value_backend_text(res, 0, COLUMNS_TABLE_OID), NULL, 10);
+                greloid = (Oid) strtoul(QR_get_value_backend_text(res, 0, COLUMNS_TABLE_OID), NULL, 10);
             if (!wti->table_oid)
                 wti->table_oid = greloid;
             if (NAME_IS_NULL(wti->schema_name))
@@ -1144,7 +1144,7 @@ MYLOG(DETAIL_LOG_LEVEL, "entering fields=" FORMAT_SIZE_T " ntab=%d\n", nfields,
     {
         TABLE_INFO    **ti = stmt->ti, *oneti;
         ConnectionClass *conn = SC_get_conn(stmt);
-        OID    internal_asis_type = SQL_C_CHAR;
+        Oid    internal_asis_type = SQL_C_CHAR;
         char        keycolnam[MAX_INFO_STRING];
         SQLLEN        keycollen;
 
@@ -1903,7 +1903,7 @@ MYLOG(0, "blevel=%d btoken=%s in_dot=%d in_field=%d tbname=%s\n", blevel, btoken
         if (wfi->func || wfi->expr || wfi->numeric)
         {
             wfi->ti = NULL;
-            wfi->columntype = wfi->basetype = (OID) 0;
+            wfi->columntype = wfi->basetype = (Oid) 0;
             parse = FALSE;
             continue;
         }
diff --git a/pgapifunc.h b/pgapifunc.h
index 5c5b20d..d56a0a8 100644
--- a/pgapifunc.h
+++ b/pgapifunc.h
@@ -45,7 +45,7 @@ RETCODE SQL_API PGAPI_Columns(HSTMT StatementHandle,
               const SQLCHAR *TableName, SQLSMALLINT NameLength3,
               const SQLCHAR *ColumnName, SQLSMALLINT NameLength4,
               UWORD flag,
-              OID    reloid,
+              Oid    reloid,
               Int2 attnum);
 RETCODE SQL_API PGAPI_Connect(HDBC ConnectionHandle,
         const SQLCHAR *ServerName, SQLSMALLINT NameLength1,
@@ -231,7 +231,7 @@ RETCODE SQL_API PGAPI_PrimaryKeys(
                   SQLSMALLINT cbSchemaName,
                   const SQLCHAR *szTableName,
                   SQLSMALLINT cbTableName,
-                  OID    reloid);
+                  Oid    reloid);
 RETCODE SQL_API PGAPI_ProcedureColumns(
                        HSTMT hstmt,
                        const SQLCHAR *szCatalogName,
diff --git a/pgtypes.c b/pgtypes.c
index bee10ec..ae2c2d3 100644
--- a/pgtypes.c
+++ b/pgtypes.c
@@ -47,7 +47,7 @@ SQLSMALLINT ansi_to_wtype(const ConnectionClass *self, SQLSMALLINT ansitype)
 #endif /* UNICODE_SUPPORT */
 }
 
-Int4        getCharColumnSize(const StatementClass *stmt, OID type, int col, int handle_unknown_size_as);
+Int4        getCharColumnSize(const StatementClass *stmt, Oid type, int col, int handle_unknown_size_as);
 
 /*
  * these are the types we support.    all of the pgtype_ functions should
@@ -150,8 +150,8 @@ SQLSMALLINT    sqlTypes[] = {
 #define    ALLOWED_C_BIGINT    SQL_C_CHAR
 #endif
 
-OID
-pg_true_type(const ConnectionClass *conn, OID type, OID basetype)
+Oid
+pg_true_type(const ConnectionClass *conn, Oid type, Oid basetype)
 {
     if (0 == basetype)
         return type;
@@ -260,7 +260,7 @@ MYLOG(0, "entering atttypmod=%x\n", atttypmod);
 }
 
 static Int4
-getCharColumnSizeX(const ConnectionClass *conn, OID type, int atttypmod, int adtsize_or_longestlen, int
handle_unknown_size_as)
+getCharColumnSizeX(const ConnectionClass *conn, Oid type, int atttypmod, int adtsize_or_longestlen, int
handle_unknown_size_as)
 {
     int        p = -1, maxsize;
     const ConnInfo    *ci = &(conn->connInfo);
@@ -366,7 +366,7 @@ MYLOG(DETAIL_LOG_LEVEL, "!!! catalog_result=%d\n", handle_unknown_size_as);
 #define    UNUSED_HANDLE_UNKNOWN_SIZE_AS    (-2)
 
 static SQLSMALLINT
-getNumericDecimalDigitsX(const ConnectionClass *conn, OID type, int atttypmod, int adtsize_or_longest, int
UNUSED_handle_unknown_size_as)
+getNumericDecimalDigitsX(const ConnectionClass *conn, Oid type, int atttypmod, int adtsize_or_longest, int
UNUSED_handle_unknown_size_as)
 {
     Int4        default_decimal_digits = 6;
 
@@ -384,7 +384,7 @@ getNumericDecimalDigitsX(const ConnectionClass *conn, OID type, int atttypmod, i
 }
 
 static Int4    /* PostgreSQL restritiction */
-getNumericColumnSizeX(const ConnectionClass *conn, OID type, int atttypmod, int adtsize_or_longest, int
handle_unknown_size_as)
+getNumericColumnSizeX(const ConnectionClass *conn, Oid type, int atttypmod, int adtsize_or_longest, int
handle_unknown_size_as)
 {
     Int4    default_column_size = 28;
     const ConnInfo    *ci = &(conn->connInfo);
@@ -422,14 +422,14 @@ getNumericColumnSizeX(const ConnectionClass *conn, OID type, int atttypmod, int
 }
 
 static SQLSMALLINT
-getTimestampDecimalDigitsX(const ConnectionClass *conn, OID type, int atttypmod)
+getTimestampDecimalDigitsX(const ConnectionClass *conn, Oid type, int atttypmod)
 {
     MYLOG(0, "type=%d, atttypmod=%d\n", type, atttypmod);
     return (atttypmod > -1 ? atttypmod : 6);
 }
 
 static SQLSMALLINT
-getTimestampColumnSizeX(const ConnectionClass *conn, OID type, int atttypmod)
+getTimestampColumnSizeX(const ConnectionClass *conn, Oid type, int atttypmod)
 {
     Int4    fixed, scale;
 
@@ -458,7 +458,7 @@ getTimestampColumnSizeX(const ConnectionClass *conn, OID type, int atttypmod)
 }
 
 static SQLSMALLINT
-getIntervalDecimalDigits(OID type, int atttypmod)
+getIntervalDecimalDigits(Oid type, int atttypmod)
 {
     Int4    prec;
 
@@ -470,7 +470,7 @@ getIntervalDecimalDigits(OID type, int atttypmod)
 }
 
 static SQLSMALLINT
-getIntervalColumnSize(OID type, int atttypmod)
+getIntervalColumnSize(Oid type, int atttypmod)
 {
     Int4    ttl, leading_precision = 9, scale;
 
@@ -515,7 +515,7 @@ getIntervalColumnSize(OID type, int atttypmod)
 
 
 SQLSMALLINT
-pgtype_attr_to_concise_type(const ConnectionClass *conn, OID type, int atttypmod, int adtsize_or_longestlen, int
handle_unknown_size_as)
+pgtype_attr_to_concise_type(const ConnectionClass *conn, Oid type, int atttypmod, int adtsize_or_longestlen, int
handle_unknown_size_as)
 {
     const ConnInfo    *ci = &(conn->connInfo);
     EnvironmentClass *env = (EnvironmentClass *) CC_get_env(conn);
@@ -646,7 +646,7 @@ pgtype_attr_to_concise_type(const ConnectionClass *conn, OID type, int atttypmod
 }
 
 SQLSMALLINT
-pgtype_attr_to_sqldesctype(const ConnectionClass *conn, OID type, int atttypmod, int adtsize_or_longestlen, int
handle_unknown_size_as)
+pgtype_attr_to_sqldesctype(const ConnectionClass *conn, Oid type, int atttypmod, int adtsize_or_longestlen, int
handle_unknown_size_as)
 {
     SQLSMALLINT    rettype;
 
@@ -665,7 +665,7 @@ pgtype_attr_to_sqldesctype(const ConnectionClass *conn, OID type, int atttypmod,
 }
 
 SQLSMALLINT
-pgtype_attr_to_datetime_sub(const ConnectionClass *conn, OID type, int atttypmod)
+pgtype_attr_to_datetime_sub(const ConnectionClass *conn, Oid type, int atttypmod)
 {
     SQLSMALLINT    rettype;
 
@@ -696,7 +696,7 @@ pgtype_attr_to_datetime_sub(const ConnectionClass *conn, OID type, int atttypmod
 }
 
 SQLSMALLINT
-pgtype_attr_to_ctype(const ConnectionClass *conn, OID type, int atttypmod)
+pgtype_attr_to_ctype(const ConnectionClass *conn, Oid type, int atttypmod)
 {
     const ConnInfo    *ci = &(conn->connInfo);
     EnvironmentClass *env = (EnvironmentClass *) CC_get_env(conn);
@@ -777,7 +777,7 @@ pgtype_attr_to_ctype(const ConnectionClass *conn, OID type, int atttypmod)
 }
 
 const char *
-pgtype_attr_to_name(const ConnectionClass *conn, OID type, int atttypmod, BOOL auto_increment)
+pgtype_attr_to_name(const ConnectionClass *conn, Oid type, int atttypmod, BOOL auto_increment)
 {
     const char    *tname = NULL;
 
@@ -869,7 +869,7 @@ MYLOG(DETAIL_LOG_LEVEL, "pgtype_to_name int4\n");
 
 
 Int4    /* PostgreSQL restriction */
-pgtype_attr_column_size(const ConnectionClass *conn, OID type, int atttypmod, int adtsize_or_longest, int
handle_unknown_size_as)
+pgtype_attr_column_size(const ConnectionClass *conn, Oid type, int atttypmod, int adtsize_or_longest, int
handle_unknown_size_as)
 {
     const ConnInfo    *ci = &(conn->connInfo);
 
@@ -972,7 +972,7 @@ pgtype_attr_column_size(const ConnectionClass *conn, OID type, int atttypmod, in
 }
 
 SQLSMALLINT
-pgtype_attr_precision(const ConnectionClass *conn, OID type, int atttypmod, int adtsize_or_longest, int
handle_unknown_size_as)
+pgtype_attr_precision(const ConnectionClass *conn, Oid type, int atttypmod, int adtsize_or_longest, int
handle_unknown_size_as)
 {
     switch (type)
     {
@@ -991,7 +991,7 @@ pgtype_attr_precision(const ConnectionClass *conn, OID type, int atttypmod, int
 }
 
 Int4
-pgtype_attr_display_size(const ConnectionClass *conn, OID type, int atttypmod, int adtsize_or_longestlen, int
handle_unknown_size_as)
+pgtype_attr_display_size(const ConnectionClass *conn, Oid type, int atttypmod, int adtsize_or_longestlen, int
handle_unknown_size_as)
 {
     int    dsize;
 
@@ -1040,7 +1040,7 @@ pgtype_attr_display_size(const ConnectionClass *conn, OID type, int atttypmod, i
 }
 
 Int4
-pgtype_attr_buffer_length(const ConnectionClass *conn, OID type, int atttypmod, int adtsize_or_longestlen, int
handle_unknown_size_as)
+pgtype_attr_buffer_length(const ConnectionClass *conn, Oid type, int atttypmod, int adtsize_or_longestlen, int
handle_unknown_size_as)
 {
     int    dsize;
 
@@ -1124,7 +1124,7 @@ pgtype_attr_buffer_length(const ConnectionClass *conn, OID type, int atttypmod,
 /*
  */
 Int4
-pgtype_attr_desclength(const ConnectionClass *conn, OID type, int atttypmod, int adtsize_or_longestlen, int
handle_unknown_size_as)
+pgtype_attr_desclength(const ConnectionClass *conn, Oid type, int atttypmod, int adtsize_or_longestlen, int
handle_unknown_size_as)
 {
     int    dsize;
 
@@ -1167,7 +1167,7 @@ pgtype_attr_desclength(const ConnectionClass *conn, OID type, int atttypmod, int
 }
 
 Int2
-pgtype_attr_decimal_digits(const ConnectionClass *conn, OID type, int atttypmod, int adtsize_or_longestlen, int
UNUSED_handle_unknown_size_as)
+pgtype_attr_decimal_digits(const ConnectionClass *conn, Oid type, int atttypmod, int adtsize_or_longestlen, int
UNUSED_handle_unknown_size_as)
 {
     switch (type)
     {
@@ -1208,7 +1208,7 @@ pgtype_attr_decimal_digits(const ConnectionClass *conn, OID type, int atttypmod,
 }
 
 Int2
-pgtype_attr_scale(const ConnectionClass *conn, OID type, int atttypmod, int adtsize_or_longestlen, int
UNUSED_handle_unknown_size_as)
+pgtype_attr_scale(const ConnectionClass *conn, Oid type, int atttypmod, int adtsize_or_longestlen, int
UNUSED_handle_unknown_size_as)
 {
     switch (type)
     {
@@ -1219,7 +1219,7 @@ pgtype_attr_scale(const ConnectionClass *conn, OID type, int atttypmod, int adts
 }
 
 Int4
-pgtype_attr_transfer_octet_length(const ConnectionClass *conn, OID type, int atttypmod, int handle_unknown_size_as)
+pgtype_attr_transfer_octet_length(const ConnectionClass *conn, Oid type, int atttypmod, int handle_unknown_size_as)
 {
     int    coef = 1;
     Int4    maxvarc, column_size;
@@ -1268,10 +1268,10 @@ pgtype_attr_transfer_octet_length(const ConnectionClass *conn, OID type, int att
  * We use cast instead to keep regression test results
  * in order to keep regression test results.
  */
-OID
+Oid
 sqltype_to_bind_pgtype(const ConnectionClass *conn, SQLSMALLINT fSqlType)
 {
-    OID        pgType = 0;
+    Oid        pgType = 0;
 
     return pgType;
 }
@@ -1345,10 +1345,10 @@ sqltype_to_pgcast(const ConnectionClass *conn, SQLSMALLINT fSqlType)
     return pgCast;
 }
 
-OID
+Oid
 sqltype_to_pgtype(const ConnectionClass *conn, SQLSMALLINT fSqlType)
 {
-    OID        pgType;
+    Oid        pgType;
     const ConnInfo    *ci = &(conn->connInfo);
 
     pgType = 0; /* ??? */
@@ -1535,7 +1535,7 @@ getAtttypmodEtc(const StatementClass *stmt, int col, int *adtsize_or_longestlen)
  *    types that are unknown.  All other pg routines in here return a suitable default.
  */
 SQLSMALLINT
-pgtype_to_concise_type(const StatementClass *stmt, OID type, int col, int handle_unknown_size_as)
+pgtype_to_concise_type(const StatementClass *stmt, Oid type, int col, int handle_unknown_size_as)
 {
     int    atttypmod, adtsize_or_longestlen;
 
@@ -1544,7 +1544,7 @@ pgtype_to_concise_type(const StatementClass *stmt, OID type, int col, int handle
 }
 
 SQLSMALLINT
-pgtype_to_sqldesctype(const StatementClass *stmt, OID type, int col, int handle_unknown_size_as)
+pgtype_to_sqldesctype(const StatementClass *stmt, Oid type, int col, int handle_unknown_size_as)
 {
     int    adtsize_or_longestlen;
     int    atttypmod = getAtttypmodEtc(stmt, col, &adtsize_or_longestlen);
@@ -1553,7 +1553,7 @@ pgtype_to_sqldesctype(const StatementClass *stmt, OID type, int col, int handle_
 }
 
 SQLSMALLINT
-pgtype_to_datetime_sub(const StatementClass *stmt, OID type, int col)
+pgtype_to_datetime_sub(const StatementClass *stmt, Oid type, int col)
 {
     int    atttypmod = getAtttypmodEtc(stmt, col, NULL);
 
@@ -1561,7 +1561,7 @@ pgtype_to_datetime_sub(const StatementClass *stmt, OID type, int col)
 }
 
 const char *
-pgtype_to_name(const StatementClass *stmt, OID type, int col, BOOL auto_increment)
+pgtype_to_name(const StatementClass *stmt, Oid type, int col, BOOL auto_increment)
 {
     int    atttypmod = getAtttypmodEtc(stmt, col, NULL);
 
@@ -1579,7 +1579,7 @@ pgtype_to_name(const StatementClass *stmt, OID type, int col, BOOL auto_incremen
  *    This is used for functions SQLDescribeCol and SQLColAttributes.
  */
 Int4    /* PostgreSQL restriction */
-pgtype_column_size(const StatementClass *stmt, OID type, int col, int handle_unknown_size_as)
+pgtype_column_size(const StatementClass *stmt, Oid type, int col, int handle_unknown_size_as)
 {
     int    atttypmod, adtsize_or_longestlen;
 
@@ -1591,7 +1591,7 @@ pgtype_column_size(const StatementClass *stmt, OID type, int col, int handle_unk
  *    precision in ODBC 3.x.
  */
 SQLSMALLINT
-pgtype_precision(const StatementClass *stmt, OID type, int col, int handle_unknown_size_as)
+pgtype_precision(const StatementClass *stmt, Oid type, int col, int handle_unknown_size_as)
 {
     int    atttypmod, adtsize_or_longestlen;
 
@@ -1601,7 +1601,7 @@ pgtype_precision(const StatementClass *stmt, OID type, int col, int handle_unkno
 
 
 Int4
-pgtype_display_size(const StatementClass *stmt, OID type, int col, int handle_unknown_size_as)
+pgtype_display_size(const StatementClass *stmt, Oid type, int col, int handle_unknown_size_as)
 {
     int    atttypmod, adtsize_or_longestlen;
 
@@ -1615,7 +1615,7 @@ pgtype_display_size(const StatementClass *stmt, OID type, int col, int handle_un
  *    or SQLFetchScroll operation if SQL_C_DEFAULT is specified.
  */
 Int4
-pgtype_buffer_length(const StatementClass *stmt, OID type, int col, int handle_unknown_size_as)
+pgtype_buffer_length(const StatementClass *stmt, Oid type, int col, int handle_unknown_size_as)
 {
     int    atttypmod, adtsize_or_longestlen;
 
@@ -1626,7 +1626,7 @@ pgtype_buffer_length(const StatementClass *stmt, OID type, int col, int handle_u
 /*
  */
 Int4
-pgtype_desclength(const StatementClass *stmt, OID type, int col, int handle_unknown_size_as)
+pgtype_desclength(const StatementClass *stmt, Oid type, int col, int handle_unknown_size_as)
 {
     int    atttypmod, adtsize_or_longestlen;
 
@@ -1680,7 +1680,7 @@ pgtype_transfer_octet_length(const StatementClass *stmt, OID type, int column_si
  *    corrsponds to "min_scale" in ODBC 2.x.
  */
 Int2
-pgtype_min_decimal_digits(const ConnectionClass *conn, OID type)
+pgtype_min_decimal_digits(const ConnectionClass *conn, Oid type)
 {
     switch (type)
     {
@@ -1708,7 +1708,7 @@ pgtype_min_decimal_digits(const ConnectionClass *conn, OID type)
  *    corrsponds to "max_scale" in ODBC 2.x.
  */
 Int2
-pgtype_max_decimal_digits(const ConnectionClass *conn, OID type)
+pgtype_max_decimal_digits(const ConnectionClass *conn, Oid type)
 {
     switch (type)
     {
@@ -1738,7 +1738,7 @@ pgtype_max_decimal_digits(const ConnectionClass *conn, OID type)
  *    corrsponds to "scale" in ODBC 2.x.
  */
 Int2
-pgtype_decimal_digits(const StatementClass *stmt, OID type, int col)
+pgtype_decimal_digits(const StatementClass *stmt, Oid type, int col)
 {
     int    atttypmod, adtsize_or_longestlen;
 
@@ -1750,7 +1750,7 @@ pgtype_decimal_digits(const StatementClass *stmt, OID type, int col)
  *    "scale" in ODBC 3.x.
  */
 Int2
-pgtype_scale(const StatementClass *stmt, OID type, int col)
+pgtype_scale(const StatementClass *stmt, Oid type, int col)
 {
     int    atttypmod, adtsize_or_longestlen;
 
@@ -1760,7 +1760,7 @@ pgtype_scale(const StatementClass *stmt, OID type, int col)
 
 
 Int2
-pgtype_radix(const ConnectionClass *conn, OID type)
+pgtype_radix(const ConnectionClass *conn, Oid type)
 {
     switch (type)
     {
@@ -1781,14 +1781,14 @@ pgtype_radix(const ConnectionClass *conn, OID type)
 
 
 Int2
-pgtype_nullable(const ConnectionClass *conn, OID type)
+pgtype_nullable(const ConnectionClass *conn, Oid type)
 {
     return SQL_NULLABLE;        /* everything should be nullable */
 }
 
 
 Int2
-pgtype_auto_increment(const ConnectionClass *conn, OID type)
+pgtype_auto_increment(const ConnectionClass *conn, Oid type)
 {
     switch (type)
     {
@@ -1819,7 +1819,7 @@ pgtype_auto_increment(const ConnectionClass *conn, OID type)
 
 
 Int2
-pgtype_case_sensitive(const ConnectionClass *conn, OID type)
+pgtype_case_sensitive(const ConnectionClass *conn, Oid type)
 {
     switch (type)
     {
@@ -1839,7 +1839,7 @@ pgtype_case_sensitive(const ConnectionClass *conn, OID type)
 
 
 Int2
-pgtype_money(const ConnectionClass *conn, OID type)
+pgtype_money(const ConnectionClass *conn, Oid type)
 {
     switch (type)
     {
@@ -1852,7 +1852,7 @@ pgtype_money(const ConnectionClass *conn, OID type)
 
 
 Int2
-pgtype_searchable(const ConnectionClass *conn, OID type)
+pgtype_searchable(const ConnectionClass *conn, Oid type)
 {
     switch (type)
     {
@@ -1874,7 +1874,7 @@ pgtype_searchable(const ConnectionClass *conn, OID type)
 
 
 Int2
-pgtype_unsigned(const ConnectionClass *conn, OID type)
+pgtype_unsigned(const ConnectionClass *conn, Oid type)
 {
     switch (type)
     {
@@ -1898,7 +1898,7 @@ pgtype_unsigned(const ConnectionClass *conn, OID type)
 
 
 const char *
-pgtype_literal_prefix(const ConnectionClass *conn, OID type)
+pgtype_literal_prefix(const ConnectionClass *conn, Oid type)
 {
     switch (type)
     {
@@ -1920,7 +1920,7 @@ pgtype_literal_prefix(const ConnectionClass *conn, OID type)
 
 
 const char *
-pgtype_literal_suffix(const ConnectionClass *conn, OID type)
+pgtype_literal_suffix(const ConnectionClass *conn, Oid type)
 {
     switch (type)
     {
@@ -1942,7 +1942,7 @@ pgtype_literal_suffix(const ConnectionClass *conn, OID type)
 
 
 const char *
-pgtype_create_params(const ConnectionClass *conn, OID type)
+pgtype_create_params(const ConnectionClass *conn, Oid type)
 {
     switch (type)
     {
diff --git a/pgtypes.h b/pgtypes.h
index 894b6d6..554892b 100644
--- a/pgtypes.h
+++ b/pgtypes.h
@@ -83,53 +83,53 @@ extern SQLSMALLINT sqlTypes[];
 #define    PG_INTERVAL_AS_SQL_INTERVAL
  */
 
-OID        pg_true_type(const ConnectionClass *, OID, OID);
-OID        sqltype_to_pgtype(const ConnectionClass *conn, SQLSMALLINT fSqlType);
-OID        sqltype_to_bind_pgtype(const ConnectionClass *conn, SQLSMALLINT fSqlType);
+Oid        pg_true_type(const ConnectionClass *, Oid, Oid);
+Oid        sqltype_to_pgtype(const ConnectionClass *conn, SQLSMALLINT fSqlType);
+Oid        sqltype_to_bind_pgtype(const ConnectionClass *conn, SQLSMALLINT fSqlType);
 const char    *sqltype_to_pgcast(const ConnectionClass *conn, SQLSMALLINT fSqlType);
 
-SQLSMALLINT    pgtype_to_concise_type(const StatementClass *stmt, OID type, int col, int handle_unknown_size_as);
-SQLSMALLINT    pgtype_to_sqldesctype(const StatementClass *stmt, OID type, int col, int handle_unknown_size_as);
-SQLSMALLINT    pgtype_to_datetime_sub(const StatementClass *stmt, OID type, int col);
-const char    *pgtype_to_name(const StatementClass *stmt, OID type, int col, BOOL auto_increment);
-
-SQLSMALLINT    pgtype_attr_to_concise_type(const ConnectionClass *conn, OID type, int typmod, int
adtsize_or_longestlen,inthandle_unknown_size_as);
 
-SQLSMALLINT    pgtype_attr_to_sqldesctype(const ConnectionClass *conn, OID type, int typmod, int
adtsize_or_longestlen,int handle_unknown_size_as);
 
-SQLSMALLINT    pgtype_attr_to_datetime_sub(const ConnectionClass *conn, OID type, int typmod);
-SQLSMALLINT    pgtype_attr_to_ctype(const ConnectionClass *conn, OID type, int typmod);
-const char    *pgtype_attr_to_name(const ConnectionClass *conn, OID type, int typmod, BOOL auto_increment);
-Int4        pgtype_attr_column_size(const ConnectionClass *conn, OID type, int atttypmod, int adtsize_or_longest, int
handle_unknown_size_as);
-Int4        pgtype_attr_buffer_length(const ConnectionClass *conn, OID type, int atttypmod, int adtsize_or_longestlen,
inthandle_unknown_size_as);
 
-Int4        pgtype_attr_display_size(const ConnectionClass *conn, OID type, int atttypmod, int adtsize_or_longestlen,
inthandle_unknown_size_as);
 
-Int2        pgtype_attr_decimal_digits(const ConnectionClass *conn, OID type, int atttypmod, int
adtsize_or_longestlen,int handle_unknown_size_as);
 
-Int4        pgtype_attr_transfer_octet_length(const ConnectionClass *conn, OID type, int atttypmod, int
handle_unknown_size_as);
-SQLSMALLINT    pgtype_attr_precision(const ConnectionClass *conn, OID type, int atttypmod, int adtsize_or_longest, int
handle_unknown_size_as);
-Int4        pgtype_attr_desclength(const ConnectionClass *conn, OID type, int atttypmod, int adtsize_or_longestlen,
inthandle_unknown_size_as);
 
-Int2        pgtype_attr_scale(const ConnectionClass *conn, OID type, int atttypmod, int adtsize_or_longestlen, int
handle_unknown_size_as);
+SQLSMALLINT    pgtype_to_concise_type(const StatementClass *stmt, Oid type, int col, int handle_unknown_size_as);
+SQLSMALLINT    pgtype_to_sqldesctype(const StatementClass *stmt, Oid type, int col, int handle_unknown_size_as);
+SQLSMALLINT    pgtype_to_datetime_sub(const StatementClass *stmt, Oid type, int col);
+const char    *pgtype_to_name(const StatementClass *stmt, Oid type, int col, BOOL auto_increment);
+
+SQLSMALLINT    pgtype_attr_to_concise_type(const ConnectionClass *conn, Oid type, int typmod, int
adtsize_or_longestlen,inthandle_unknown_size_as);
 
+SQLSMALLINT    pgtype_attr_to_sqldesctype(const ConnectionClass *conn, Oid type, int typmod, int
adtsize_or_longestlen,int handle_unknown_size_as);
 
+SQLSMALLINT    pgtype_attr_to_datetime_sub(const ConnectionClass *conn, Oid type, int typmod);
+SQLSMALLINT    pgtype_attr_to_ctype(const ConnectionClass *conn, Oid type, int typmod);
+const char    *pgtype_attr_to_name(const ConnectionClass *conn, Oid type, int typmod, BOOL auto_increment);
+Int4        pgtype_attr_column_size(const ConnectionClass *conn, Oid type, int atttypmod, int adtsize_or_longest, int
handle_unknown_size_as);
+Int4        pgtype_attr_buffer_length(const ConnectionClass *conn, Oid type, int atttypmod, int adtsize_or_longestlen,
inthandle_unknown_size_as);
 
+Int4        pgtype_attr_display_size(const ConnectionClass *conn, Oid type, int atttypmod, int adtsize_or_longestlen,
inthandle_unknown_size_as);
 
+Int2        pgtype_attr_decimal_digits(const ConnectionClass *conn, Oid type, int atttypmod, int
adtsize_or_longestlen,int handle_unknown_size_as);
 
+Int4        pgtype_attr_transfer_octet_length(const ConnectionClass *conn, Oid type, int atttypmod, int
handle_unknown_size_as);
+SQLSMALLINT    pgtype_attr_precision(const ConnectionClass *conn, Oid type, int atttypmod, int adtsize_or_longest, int
handle_unknown_size_as);
+Int4        pgtype_attr_desclength(const ConnectionClass *conn, Oid type, int atttypmod, int adtsize_or_longestlen,
inthandle_unknown_size_as);
 
+Int2        pgtype_attr_scale(const ConnectionClass *conn, Oid type, int atttypmod, int adtsize_or_longestlen, int
handle_unknown_size_as);
 
 /*    These functions can use static numbers or result sets(col parameter) */
-Int4        pgtype_column_size(const StatementClass *stmt, OID type, int col, int handle_unknown_size_as); /*
correspondsto "precision" in ODBC 2.x */
 
-SQLSMALLINT    pgtype_precision(const StatementClass *stmt, OID type, int col, int handle_unknown_size_as); /*
"precsionin ODBC 3.x */
 
+Int4        pgtype_column_size(const StatementClass *stmt, Oid type, int col, int handle_unknown_size_as); /*
correspondsto "precision" in ODBC 2.x */
 
+SQLSMALLINT    pgtype_precision(const StatementClass *stmt, Oid type, int col, int handle_unknown_size_as); /*
"precsionin ODBC 3.x */
 
 /* the following size/length are of Int4 due to PG restriction */
-Int4        pgtype_display_size(const StatementClass *stmt, OID type, int col, int handle_unknown_size_as);
-Int4        pgtype_buffer_length(const StatementClass *stmt, OID type, int col, int handle_unknown_size_as);
-Int4        pgtype_desclength(const StatementClass *stmt, OID type, int col, int handle_unknown_size_as);
+Int4        pgtype_display_size(const StatementClass *stmt, Oid type, int col, int handle_unknown_size_as);
+Int4        pgtype_buffer_length(const StatementClass *stmt, Oid type, int col, int handle_unknown_size_as);
+Int4        pgtype_desclength(const StatementClass *stmt, Oid type, int col, int handle_unknown_size_as);
 // Int4        pgtype_transfer_octet_length(const ConnectionClass *conn, OID type, int column_size);
 
-SQLSMALLINT    pgtype_decimal_digits(const StatementClass *stmt, OID type, int col); /* corresponds to "scale" in ODBC
2.x*/
 
-SQLSMALLINT    pgtype_min_decimal_digits(const ConnectionClass *conn, OID type); /* corresponds to "min_scale" in ODBC
2.x*/
 
-SQLSMALLINT    pgtype_max_decimal_digits(const ConnectionClass *conn, OID type); /* corresponds to "max_scale" in ODBC
2.x*/
 
-SQLSMALLINT    pgtype_scale(const StatementClass *stmt, OID type, int col); /* ODBC 3.x " */
-Int2        pgtype_radix(const ConnectionClass *conn, OID type);
-Int2        pgtype_nullable(const ConnectionClass *conn, OID type);
-Int2        pgtype_auto_increment(const ConnectionClass *conn, OID type);
-Int2        pgtype_case_sensitive(const ConnectionClass *conn, OID type);
-Int2        pgtype_money(const ConnectionClass *conn, OID type);
-Int2        pgtype_searchable(const ConnectionClass *conn, OID type);
-Int2        pgtype_unsigned(const ConnectionClass *conn, OID type);
-const char    *pgtype_literal_prefix(const ConnectionClass *conn, OID type);
-const char    *pgtype_literal_suffix(const ConnectionClass *conn, OID type);
-const char    *pgtype_create_params(const ConnectionClass *conn, OID type);
+SQLSMALLINT    pgtype_decimal_digits(const StatementClass *stmt, Oid type, int col); /* corresponds to "scale" in ODBC
2.x*/
 
+SQLSMALLINT    pgtype_min_decimal_digits(const ConnectionClass *conn, Oid type); /* corresponds to "min_scale" in ODBC
2.x*/
 
+SQLSMALLINT    pgtype_max_decimal_digits(const ConnectionClass *conn, Oid type); /* corresponds to "max_scale" in ODBC
2.x*/
 
+SQLSMALLINT    pgtype_scale(const StatementClass *stmt, Oid type, int col); /* ODBC 3.x " */
+Int2        pgtype_radix(const ConnectionClass *conn, Oid type);
+Int2        pgtype_nullable(const ConnectionClass *conn, Oid type);
+Int2        pgtype_auto_increment(const ConnectionClass *conn, Oid type);
+Int2        pgtype_case_sensitive(const ConnectionClass *conn, Oid type);
+Int2        pgtype_money(const ConnectionClass *conn, Oid type);
+Int2        pgtype_searchable(const ConnectionClass *conn, Oid type);
+Int2        pgtype_unsigned(const ConnectionClass *conn, Oid type);
+const char    *pgtype_literal_prefix(const ConnectionClass *conn, Oid type);
+const char    *pgtype_literal_suffix(const ConnectionClass *conn, Oid type);
+const char    *pgtype_create_params(const ConnectionClass *conn, Oid type);
 
 SQLSMALLINT    sqltype_to_default_ctype(const ConnectionClass *stmt, SQLSMALLINT sqltype);
 Int4        ctype_length(SQLSMALLINT ctype);
diff --git a/psqlodbc.h b/psqlodbc.h
index dfa4293..2e6f2f6 100644
--- a/psqlodbc.h
+++ b/psqlodbc.h
@@ -145,7 +145,8 @@ extern "C" {
 #define Int2 short
 #define UInt2 unsigned short
 typedef SQLBIGINT Int8;
-typedef    UInt4    OID;
+
+#include "postgres_ext.h"
 
 #ifndef SQL_TRUE
 #define SQL_TRUE TRUE
diff --git a/qresult.c b/qresult.c
index c89a3ea..4fff0bb 100644
--- a/qresult.c
+++ b/qresult.c
@@ -587,7 +587,7 @@ QR_from_PGresult(QResultClass *self, StatementClass *stmt, ConnectionClass *conn
     IPDFields  *ipdopts;
     Int2        lf;
     int            new_num_fields;
-    OID            new_adtid, new_relid = 0, new_attid = 0;
+    Oid            new_adtid, new_relid = 0, new_attid = 0;
     Int2        new_adtsize;
     Int4        new_atttypmod = -1;
     char       *new_field_name;
@@ -614,7 +614,7 @@ QR_from_PGresult(QResultClass *self, StatementClass *stmt, ConnectionClass *conn
         new_field_name = PQfname(*pgres, lf);
         new_relid = PQftable(*pgres, lf);
         new_attid = PQftablecol(*pgres, lf);
-        new_adtid = (OID) PQftype(*pgres, lf);
+        new_adtid = (Oid) PQftype(*pgres, lf);
         new_adtsize = (Int2) PQfsize(*pgres, lf);
         new_atttypmod = (Int4) PQfmod(*pgres, lf);
 
diff --git a/results.c b/results.c
index 9be2d52..0f96118 100644
--- a/results.c
+++ b/results.c
@@ -105,7 +105,7 @@ SC_describe_ok(StatementClass *stmt, BOOL build_fi, int col_idx, const char *fun
     }
     else if (col_idx >= 0 && col_idx < num_fields)
     {
-        OID    reloid = QR_get_relid(result, col_idx);
+        Oid    reloid = QR_get_relid(result, col_idx);
         IRDFields    *irdflds = SC_get_IRDF(stmt);
         FIELD_INFO    *fi;
         TABLE_INFO    *ti = NULL;
@@ -225,7 +225,7 @@ PGAPI_DescribeCol(HSTMT hstmt,
     IRDFields  *irdflds;
     QResultClass *res = NULL;
     char       *col_name = NULL;
-    OID            fieldtype = 0;
+    Oid            fieldtype = 0;
     SQLLEN        column_size = 0;
     int        unknown_sizes;
     SQLINTEGER    decimal_digits = 0;
@@ -473,7 +473,7 @@ PGAPI_ColAttributes(HSTMT hstmt,
     CSTR func = "PGAPI_ColAttributes";
     StatementClass *stmt = (StatementClass *) hstmt;
     IRDFields    *irdflds;
-    OID        field_type = 0;
+    Oid        field_type = 0;
     Int2        col_idx;
     ConnectionClass    *conn;
     ConnInfo    *ci;
@@ -916,7 +916,7 @@ PGAPI_GetData(HSTMT hstmt,
     StatementClass *stmt = (StatementClass *) hstmt;
     UInt2        num_cols;
     SQLLEN        num_rows;
-    OID        field_type;
+    Oid        field_type;
     int        atttypmod;
     void       *value = NULL;
     RETCODE        result = SQL_SUCCESS;
@@ -2040,7 +2040,7 @@ static Int2    getNumResultCols(const QResultClass *res)
     Int2    res_cols = QR_NumPublicResultCols(res);
     return res_cols;
 }
-static OID    getOid(const QResultClass *res, SQLLEN index)
+static Oid    getOid(const QResultClass *res, SQLLEN index)
 {
     return res->keyset[index].oid;
 }
@@ -2184,7 +2184,7 @@ MYLOG(DETAIL_LOG_LEVEL, "[%d,%d] %s copied\n", i / num_fields, i % num_fields, (
 }
 
 static const char *
-ti_quote(StatementClass *stmt, OID tableoid, char *buf, int buf_size)
+ti_quote(StatementClass *stmt, Oid tableoid, char *buf, int buf_size)
 {
     TABLE_INFO    *ti = stmt->ti[0];
     pgNAME        rNAME;
@@ -3048,7 +3048,7 @@ MYLOG(DETAIL_LOG_LEVEL, "entering bestitem=%s bestqual=%s\n", SAFE_NAME(ti->best
 #define    return    DONT_CALL_RETURN_FROM_HERE???
     if (TI_has_subclass(ti))
     {
-        OID    tableoid = *oidint;
+        Oid    tableoid = *oidint;
         char    table_fqn[256];
         const char    *quoted_table;
 
@@ -3172,7 +3172,7 @@ SC_pos_reload_with_key(StatementClass *stmt, SQLULEN global_ridx, UInt2 *count,
     int        res_cols;
     UInt2        rcnt;
     SQLLEN        kres_ridx;
-    OID        oidint;
+    Oid        oidint;
     QResultClass    *res, *qres;
     IRDFields    *irdflds = SC_get_IRDF(stmt);
     RETCODE        ret = SQL_ERROR;
@@ -3322,7 +3322,7 @@ static SQLLEN LoadFromKeyset(StatementClass *stmt, QResultClass * res, int rows_
     ConnectionClass    *conn = SC_get_conn(stmt);
     SQLLEN    i;
     int    j, rowc, rcnt = 0;
-    OID    oid;
+    Oid    oid;
     UInt4    blocknum;
     SQLLEN    kres_ridx;
     UInt2    offset;
@@ -3494,7 +3494,7 @@ static SQLLEN LoadFromKeyset_inh(StatementClass *stmt, QResultClass * res, int r
     ConnectionClass    *conn = SC_get_conn(stmt);
     SQLLEN    i;
     int    j, rowc, rcnt = 0;
-    OID    oid, new_oid;
+    Oid    oid, new_oid;
     UInt4    blocknum;
     SQLLEN    kres_ridx;
     UInt2    offset;
@@ -3540,7 +3540,7 @@ MYLOG(0, "entering in rows_per_fetch=%d limitrow=" FORMAT_LEN "\n", rows_per_fet
                 TupleField    *tuple, *tuplew;
                 UInt4        bln;
                 UInt2        off;
-                OID        tbloid;
+                Oid        tbloid;
 
                 for (j = 0; j < QR_get_num_total_read(qres); j++)
                 {
@@ -3958,7 +3958,7 @@ SC_pos_update(StatementClass *stmt,
     FIELD_INFO    **fi;
     PQExpBufferData        updstr = {0};
     RETCODE        ret = SQL_ERROR;
-    OID    oid;
+    Oid    oid;
     UInt4    blocknum;
     UInt2    pgoffset;
     SQLLEN    offset;
@@ -4059,7 +4059,7 @@ SC_pos_update(StatementClass *stmt,
         ConnInfo    *ci = &(conn->connInfo);
         APDFields    *apdopts;
         IPDFields    *ipdopts;
-        OID        fieldtype = 0;
+        Oid        fieldtype = 0;
         const char *bestitem = GET_NAME(ti->bestitem);
         const char *bestqual = GET_NAME(ti->bestqual);
         int    unknown_sizes = ci->drivers.unknown_sizes;
@@ -4173,7 +4173,7 @@ SC_pos_delete(StatementClass *stmt,
     PQExpBufferData        dltstr = {0};
     RETCODE        ret;
     SQLLEN        kres_ridx;
-    OID        oid;
+    Oid        oid;
     UInt4        blocknum, qflag;
     TABLE_INFO    *ti;
     const char    *bestitem;
@@ -4335,7 +4335,7 @@ irow_insert(RETCODE ret, StatementClass *stmt, StatementClass *istmt,
     if (ret != SQL_ERROR)
     {
         int        addcnt;
-        OID        oid, *poid = NULL;
+        Oid        oid, *poid = NULL;
         ARDFields    *opts = SC_get_ARDF(stmt);
         QResultClass    *ires = SC_get_Curres(istmt), *tres;
         const char *cmdstr;
@@ -4479,7 +4479,7 @@ SC_pos_add(StatementClass *stmt,
     SQLULEN        offset;
     SQLLEN        *used;
     Int4        bind_size = opts->bind_size;
-    OID        fieldtype;
+    Oid        fieldtype;
     int        unknown_sizes;
     int        func_cs_count = 0;
     char        table_fqn[256];
@@ -5021,7 +5021,7 @@ SC_fetch_by_bookmark(StatementClass *stmt)
 {
     UInt2        offset;
     SQLLEN        kres_ridx;
-    OID        oidint;
+    Oid        oidint;
     UInt4        blocknum;
     QResultClass    *res, *qres;
     RETCODE        ret = SQL_ERROR;
diff --git a/statement.c b/statement.c
index 93964fb..95b8ce3 100644
--- a/statement.c
+++ b/statement.c
@@ -1637,7 +1637,7 @@ SC_fetch(StatementClass *self)
 
     Int2        num_cols,
                 lf;
-    OID            type;
+    Oid            type;
     int        atttypmod;
     char       *value;
     ColumnInfoClass *coli;
diff --git a/test/src/catalogfunctions-test.c b/test/src/catalogfunctions-test.c
index b93ec69..d661654 100644
--- a/test/src/catalogfunctions-test.c
+++ b/test/src/catalogfunctions-test.c
@@ -76,7 +76,7 @@ main(int argc, char **argv)
     print_result_meta(hstmt);
     /*
      * Print only the 6 first columns, we do not want for example
-     * to get the OID in output, and this information looks to be
+     * to get the Oid in output, and this information looks to be
      * enough.
      */
     print_result_series(hstmt, sql_column_ids, 6, -1);
diff --git a/test/src/result-conversions-test.c b/test/src/result-conversions-test.c
index 4af85a8..80a7faa 100644
--- a/test/src/result-conversions-test.c
+++ b/test/src/result-conversions-test.c
@@ -36,7 +36,7 @@ static const char *pgtypes[] =
     "1234567",        "int4",
     "int4pl",        "regproc",
     "textdata",        "text",
-/*    "3234567901",    "oid", */ /* OID can be confused with large objects */
+/*    "3234567901",    "oid", */ /* Oid can be confused with large objects */
     "(1,2)",        "tid",
     "1234",            "xid",
     "4321",            "cid",
diff --git a/tuple.h b/tuple.h
index 22c48f5..d2e1c2b 100644
--- a/tuple.h
+++ b/tuple.h
@@ -28,7 +28,7 @@ struct KeySet_
     UWORD    status;
     UInt2    offset;
     UInt4    blocknum;
-    OID    oid;
+    Oid    oid;
 };
 /*    Rollback(index + original TID) info */
 struct Rollback_
@@ -36,7 +36,7 @@ struct Rollback_
     SQLLEN    index;
     UInt4    blocknum;
     UInt2    offset;
-    OID    oid;
+    Oid    oid;
     UWORD    option;
 };
 #define    KEYSET_INFO_PUBLIC    0x07
-- 
2.25.1




В списке pgsql-odbc по дате отправления:

Предыдущее
От: Shehroze Yousuf
Дата:
Сообщение: Postgres ODBC driver required for AIX
Следующее
От: "Torres Cervantes, Salvador"
Дата:
Сообщение: ODBC Driver for PostgreSQL