Commit 5a303f87 authored by Marc G. Fournier's avatar Marc G. Fournier

Remove all traces of the ODBC driver, which is now on GBorg as the psqlodbc
project ...
parent 03a7625a
#
# PostgreSQL top level makefile
#
# $Header: /cvsroot/pgsql/GNUmakefile.in,v 1.25 2002/08/22 00:15:04 scrappy Exp $
# $Header: /cvsroot/pgsql/GNUmakefile.in,v 1.26 2002/08/22 22:43:08 scrappy Exp $
#
subdir =
......@@ -72,7 +72,7 @@ $(distdir).tar: distdir
opt_files := src/backend/utils/mb contrib/retep/build.xml \
src/tools src/corba src/data src/tutorial \
$(addprefix src/bin/, pgaccess pgtclsh pg_encoding) \
$(addprefix src/interfaces/, odbc libpgtcl perl5 python jdbc) \
$(addprefix src/interfaces/, libpgtcl perl5 python jdbc) \
$(addprefix src/pl/, plperl tcl)
docs_files := doc/postgres.tar.gz doc/src doc/TODO.detail
......
......@@ -321,10 +321,6 @@ Installation Procedure
the only good reason to select a non-default value is if you
intend to run multiple PostgreSQL servers on the same machine.
--with-CXX
Build the C++ interface library.
--with-perl
Build the Perl interface module. The Perl interface will be
......@@ -362,35 +358,6 @@ Installation Procedure
use a different version of Tcl or Tk you can specify the directory
in which to find them.
--enable-odbc
Build the ODBC driver. By default, the driver will be independent
of a driver manager. To work better with a driver manager already
installed on your system, use one of the following options in
addition to this one. More information can be found in the
Programmer's Guide.
--with-iodbc
Build the ODBC driver for use with iODBC.
--with-unixodbc
Build the ODBC driver for use with unixODBC.
--with-odbcinst=DIRECTORY
Specifies the directory where the ODBC driver will expect its
"odbcinst.ini" configuration file. The default is
"/usr/local/pgsql/etc" or whatever you specified as
"--sysconfdir". It should be arranged that the driver reads the
same file as the driver manager.
If either the option "--with-iodbc" or the option
"--with-unixodbc" is used, this option will be ignored because in
that case the driver manager handles the location of the
configuration file.
--with-java
Build the JDBC driver and associated Java packages. This option
......
......@@ -8,8 +8,11 @@ PostgreSQL is an advanced object-relational database management system
that supports an extended subset of the SQL standard, including
transactions, foreign keys, subqueries, triggers, user-defined types
and functions. This distribution also contains several language
bindings, including C, C++, Perl, Python, and Tcl, as well as drivers
for JDBC and ODBC.
bindings, including C, Perl, Python, and Tcl, as well as drivers
for JDBC.
As of v7.3, the ODBC and C++ interfaces have been moved over to the
PostgreSQL Projects WebSite @ http://gborg.postgresql.org.
See the file INSTALL for instructions on how to build and install
PostgreSQL. That file also lists supported operating systems and
......
......@@ -845,7 +845,6 @@ Optional Features:
--enable-debug build with debugging symbols (-g)
--enable-depend turn on automatic dependency tracking
--enable-cassert enable assertion checks (for debugging)
--enable-odbc build the ODBC driver package
--disable-largefile omit support for large files
Optional Packages:
......@@ -871,9 +870,6 @@ Optional Packages:
--with-openssl[=DIR] build with OpenSSL support [/usr/local/ssl]
--without-readline do not use Readline
--without-zlib do not use Zlib
--with-unixodbc build ODBC driver for unixODBC
--with-iodbc build ODBC driver for iODBC
--with-odbcinst=DIR default directory for odbcinst.ini sysconfdir
--with-gnu-ld assume the C compiler uses GNU ld default=no
Some influential environment variables:
......@@ -3476,162 +3472,6 @@ fi;
#
# Optionally enable the building of the ODBC driver
#
# Old option name
if test "${with_odbc+set}" = set && test "${enable_odbc+set}" != set; then
enable_odbc=$with_odbc
fi
echo "$as_me:$LINENO: checking whether to build the ODBC driver" >&5
echo $ECHO_N "checking whether to build the ODBC driver... $ECHO_C" >&6
# Check whether --enable-odbc or --disable-odbc was given.
if test "${enable_odbc+set}" = set; then
enableval="$enable_odbc"
case $enableval in
yes)
:
;;
no)
:
;;
*)
{ { echo "$as_me:$LINENO: error: no argument expected for --enable-odbc option" >&5
echo "$as_me: error: no argument expected for --enable-odbc option" >&2;}
{ (exit 1); exit 1; }; }
;;
esac
else
enable_odbc=no
fi;
# Check whether --with-unixodbc or --without-unixodbc was given.
if test "${with_unixodbc+set}" = set; then
withval="$with_unixodbc"
case $withval in
yes)
:
;;
no)
:
;;
*)
{ { echo "$as_me:$LINENO: error: no argument expected for --with-unixodbc option" >&5
echo "$as_me: error: no argument expected for --with-unixodbc option" >&2;}
{ (exit 1); exit 1; }; }
;;
esac
else
with_unixodbc=no
fi;
# Check whether --with-iodbc or --without-iodbc was given.
if test "${with_iodbc+set}" = set; then
withval="$with_iodbc"
case $withval in
yes)
:
;;
no)
:
;;
*)
{ { echo "$as_me:$LINENO: error: no argument expected for --with-iodbc option" >&5
echo "$as_me: error: no argument expected for --with-iodbc option" >&2;}
{ (exit 1); exit 1; }; }
;;
esac
else
with_iodbc=no
fi;
if test "$with_unixodbc" = yes && test "$with_iodbc" = yes; then
{ { echo "$as_me:$LINENO: error: ODBC driver cannot be built for both unixODBC and iODBC" >&5
echo "$as_me: error: ODBC driver cannot be built for both unixODBC and iODBC" >&2;}
{ (exit 1); exit 1; }; }
fi
if test "$with_unixodbc" = yes || test "$with_iodbc" = yes; then
enable_odbc=yes
fi
case $enable_odbc:$with_unixodbc:$with_iodbc in
yes:no:no) echo "$as_me:$LINENO: result: yes (stand-alone)" >&5
echo "${ECHO_T}yes (stand-alone)" >&6;;
yes:yes:no) echo "$as_me:$LINENO: result: yes (unixODBC)" >&5
echo "${ECHO_T}yes (unixODBC)" >&6
cat >>confdefs.h <<\_ACEOF
#define WITH_UNIXODBC 1
_ACEOF
;;
yes:no:yes) echo "$as_me:$LINENO: result: yes (iODBC)" >&5
echo "${ECHO_T}yes (iODBC)" >&6
cat >>confdefs.h <<\_ACEOF
#define WITH_IODBC 1
_ACEOF
;;
no:*) echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6;;
esac
# Allow for overriding the default location of the odbcinst.ini
# file which is normally ${sysconfdir} (i.e., ${prefix}/etc).
# Check whether --with-odbcinst or --without-odbcinst was given.
if test "${with_odbcinst+set}" = set; then
withval="$with_odbcinst"
case $withval in
yes)
{ { echo "$as_me:$LINENO: error: argument required for --with-odbcinst option" >&5
echo "$as_me: error: argument required for --with-odbcinst option" >&2;}
{ (exit 1); exit 1; }; }
;;
no)
{ { echo "$as_me:$LINENO: error: argument required for --with-odbcinst option" >&5
echo "$as_me: error: argument required for --with-odbcinst option" >&2;}
{ (exit 1); exit 1; }; }
;;
*)
odbcinst_ini_dir=$withval
;;
esac
else
odbcinst_ini_dir="\${sysconfdir}"
fi;
# Assume system is ELF if it predefines __ELF__ as 1,
# otherwise believe host_os based default.
case $host_os in
......@@ -16459,10 +16299,6 @@ s,@with_krb5@,$with_krb5,;t t
s,@krb_srvtab@,$krb_srvtab,;t t
s,@with_pam@,$with_pam,;t t
s,@with_openssl@,$with_openssl,;t t
s,@enable_odbc@,$enable_odbc,;t t
s,@with_unixodbc@,$with_unixodbc,;t t
s,@with_iodbc@,$with_iodbc,;t t
s,@odbcinst_ini_dir@,$odbcinst_ini_dir,;t t
s,@ELF_SYS@,$ELF_SYS,;t t
s,@AWK@,$AWK,;t t
s,@FLEX@,$FLEX,;t t
......
dnl Process this file with autoconf to produce a configure script.
dnl $Header: /cvsroot/pgsql/configure.in,v 1.196 2002/08/22 00:15:06 scrappy Exp $
dnl $Header: /cvsroot/pgsql/configure.in,v 1.197 2002/08/22 22:43:08 scrappy Exp $
dnl
dnl Developers, please strive to achieve this order:
dnl
......@@ -511,50 +511,6 @@ PGAC_ARG_BOOL(with, zlib, yes,
#
# Optionally enable the building of the ODBC driver
#
# Old option name
if test "${with_odbc+set}" = set && test "${enable_odbc+set}" != set; then
enable_odbc=$with_odbc
fi
AC_MSG_CHECKING([whether to build the ODBC driver])
PGAC_ARG_BOOL(enable, odbc, no, [ --enable-odbc build the ODBC driver package])
PGAC_ARG_BOOL(with, unixodbc, no, [ --with-unixodbc build ODBC driver for unixODBC])
PGAC_ARG_BOOL(with, iodbc, no, [ --with-iodbc build ODBC driver for iODBC])
if test "$with_unixodbc" = yes && test "$with_iodbc" = yes; then
AC_MSG_ERROR([ODBC driver cannot be built for both unixODBC and iODBC])
fi
if test "$with_unixodbc" = yes || test "$with_iodbc" = yes; then
enable_odbc=yes
fi
case $enable_odbc:$with_unixodbc:$with_iodbc in
yes:no:no) AC_MSG_RESULT([yes (stand-alone)]);;
yes:yes:no) AC_MSG_RESULT([yes (unixODBC)])
AC_DEFINE(WITH_UNIXODBC, 1, [Define to 1 to build with unixODBC support (--with-unixodbc)])
;;
yes:no:yes) AC_MSG_RESULT([yes (iODBC)])
AC_DEFINE(WITH_IODBC, 1, [Define to 1 to build with iODBC support (--with-iodbc)])
;;
no:*) AC_MSG_RESULT(no);;
esac
AC_SUBST([enable_odbc])
AC_SUBST([with_unixodbc])
AC_SUBST([with_iodbc])
# Allow for overriding the default location of the odbcinst.ini
# file which is normally ${sysconfdir} (i.e., ${prefix}/etc).
PGAC_ARG_REQ(with, odbcinst,
[ --with-odbcinst=DIR default directory for odbcinst.ini [sysconfdir]],
[odbcinst_ini_dir=$withval],
[odbcinst_ini_dir="\${sysconfdir}"])
AC_SUBST([odbcinst_ini_dir])
# Assume system is ELF if it predefines __ELF__ as 1,
# otherwise believe host_os based default.
case $host_os in
......
# -*-makefile-*-
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.152 2002/07/27 20:10:04 petere Exp $
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.153 2002/08/22 22:43:10 scrappy Exp $
#------------------------------------------------------------------------------
# All PostgreSQL makefiles include this file and use the variables it sets,
......@@ -111,8 +111,6 @@ override docdir := $(docdir)/postgresql
endif
endif
odbcinst_ini_dir = @odbcinst_ini_dir@
javadir := $(DESTDIR)$(datadir)/java
localedir := @localedir@
......@@ -129,9 +127,6 @@ with_perl = @with_perl@
with_python = @with_python@
with_tcl = @with_tcl@
with_tk = @with_tk@
enable_odbc = @enable_odbc@
with_iodbc = @with_iodbc@
with_unixodbc = @with_unixodbc@
MULTIBYTE = @MULTIBYTE@
enable_shared = @enable_shared@
enable_rpath = @enable_rpath@
......
......@@ -4,7 +4,7 @@
#
# Copyright (c) 1994, Regents of the University of California
#
# $Header: /cvsroot/pgsql/src/interfaces/Makefile,v 1.46 2002/08/22 00:15:10 scrappy Exp $
# $Header: /cvsroot/pgsql/src/interfaces/Makefile,v 1.47 2002/08/22 22:43:11 scrappy Exp $
#
#-------------------------------------------------------------------------
......@@ -14,11 +14,7 @@ include $(top_builddir)/src/Makefile.global
DIRS := libpq ecpg libpgeasy
ALLDIRS := $(DIRS) odbc libpgtcl perl5 python jdbc
ifeq ($(enable_odbc), yes)
DIRS += odbc
endif
ALLDIRS := $(DIRS) libpgtcl perl5 python jdbc
ifeq ($(with_tcl), yes)
DIRS += libpgtcl
......
#-------------------------------------------------------------------------
#
# GNUMakefile for psqlodbc (Postgres ODBC driver)
#
# $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/GNUmakefile,v 1.23 2001/11/12 00:54:28 inoue Exp $
#
#-------------------------------------------------------------------------
subdir = src/interfaces/odbc
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
# Shared library parameters
ifeq ($(with_unixodbc),yes)
NAME = odbcpsql
else
NAME = psqlodbc
endif
SO_MAJOR_VERSION = 0
SO_MINOR_VERSION = 27
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS) -DFRONTEND -DMD5_ODBC
OBJS = info.o bind.o columninfo.o connection.o convert.o drvconn.o \
environ.o execute.o lobj.o md5.o misc.o options.o \
pgtypes.o psqlodbc.o qresult.o results.o socket.o parse.o statement.o \
tuple.o tuplelist.o dlg_specific.o odbcapi.o
ifdef MULTIBYTE
OBJS += multibyte.o
endif
SHLIB_LINK += $(filter -lm -lnsl -lsocket, $(LIBS))
ifeq ($(with_unixodbc),yes)
SHLIB_LINK += -lodbcinst
endif
ifeq ($(with_iodbc),yes)
SHLIB_LINK += -liodbcinst
endif
ifeq ($(with_unixodbc)$(with_iodbc),nono)
OBJS += gpps.o
override CPPFLAGS += -DODBCINSTDIR='"$(odbcinst_ini_dir)"'
endif
all: all-lib odbc-drop.sql
# Shared library stuff
include $(top_srcdir)/src/Makefile.shlib
# Symbols must be resolved to the version in the shared library because
# the driver manager (e.g., iodbc) provides some symbols with the same
# names and we don't want those. (This issue is probably ELF specific.)
LINK.shared += $(shlib_symbolic)
odbc-drop.sql: odbc.sql
sed -n '/^CREATE OR REPLACE FUNCTION/s/CREATE OR REPLACE FUNCTION \([^ (][^ (]*([^)]*)\).*/DROP FUNCTION \1;/p' $< >$@
install: all installdirs
$(INSTALL_DATA) $(srcdir)/odbc.sql $(DESTDIR)$(datadir)/odbc.sql
$(INSTALL_DATA) odbc-drop.sql $(DESTDIR)$(datadir)/odbc-drop.sql
$(MAKE) install-lib
installdirs:
$(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(datadir)
uninstall: uninstall-lib
rm -f $(DESTDIR)$(datadir)/odbc.sql $(DESTDIR)$(datadir)/odbc-drop.sql
clean distclean maintainer-clean: clean-lib
rm -f $(OBJS)
rm -f odbc-drop.sql
This diff is collapsed.
/* File: bind.h
*
* Description: See "bind.c"
*
* Comments: See "notice.txt" for copyright and license information.
*
*/
#ifndef __BIND_H__
#define __BIND_H__
#include "psqlodbc.h"
/*
* BindInfoClass -- stores information about a bound column
*/
struct BindInfoClass_
{
Int4 buflen; /* size of buffer */
Int4 data_left; /* amount of data left to read
* (SQLGetData) */
char *buffer; /* pointer to the buffer */
Int4 *used; /* used space in the buffer (for strings
* not counting the '\0') */
char *ttlbuf; /* to save the large result */
Int4 ttlbuflen; /* the buffer length */
Int2 returntype; /* kind of conversion to be applied when
* returning (SQL_C_DEFAULT,
* SQL_C_CHAR...) */
Int2 precision; /* the precision for numeric or timestamp type */
Int2 scale; /* the scale for numeric type */
};
/*
* ParameterInfoClass -- stores information about a bound parameter
*/
struct ParameterInfoClass_
{
Int4 buflen;
char *buffer;
Int4 *used;
Int2 paramType;
Int2 CType;
Int2 SQLType;
Int2 decimal_digits;
UInt4 column_size;
Oid lobj_oid;
Int4 *EXEC_used; /* amount of data OR the oid of the large
* object */
char *EXEC_buffer; /* the data or the FD of the large object */
Int2 precision; /* the precision for numeric or timestamp type */
Int2 scale; /* the scale for numeric type */
char data_at_exec;
};
BindInfoClass *create_empty_bindings(int num_columns);
void extend_column_bindings(ARDFields *opts, int num_columns);
void reset_a_column_binding(ARDFields *opts, int icol);
void extend_parameter_bindings(APDFields *opts, int num_columns);
void reset_a_parameter_binding(APDFields *opts, int ipar);
#endif
/*-------
* Module: columninfo.c
*
* Description: This module contains routines related to
* reading and storing the field information from a query.
*
* Classes: ColumnInfoClass (Functions prefix: "CI_")
*
* API functions: none
*
* Comments: See "notice.txt" for copyright and license information.
*-------
*/
#include "pgtypes.h"
#include "columninfo.h"
#include "connection.h"
#include "socket.h"
#include <stdlib.h>
#include <string.h>
#include "pgapifunc.h"
ColumnInfoClass *
CI_Constructor()
{
ColumnInfoClass *rv;
rv = (ColumnInfoClass *) malloc(sizeof(ColumnInfoClass));
if (rv)
{
rv->num_fields = 0;
rv->name = NULL;
rv->adtid = NULL;
rv->adtsize = NULL;
rv->display_size = NULL;
rv->atttypmod = NULL;
}
return rv;
}
void
CI_Destructor(ColumnInfoClass *self)
{
CI_free_memory(self);
free(self);
}
/*
* Read in field descriptions.
* If self is not null, then also store the information.
* If self is null, then just read, don't store.
*/
char
CI_read_fields(ColumnInfoClass *self, ConnectionClass *conn)
{
Int2 lf;
int new_num_fields;
Oid new_adtid;
Int2 new_adtsize;
Int4 new_atttypmod = -1;
/* MAX_COLUMN_LEN may be sufficient but for safety */
char new_field_name[2 * MAX_COLUMN_LEN + 1];
SocketClass *sock;
ConnInfo *ci;
sock = CC_get_socket(conn);
ci = &conn->connInfo;
/* at first read in the number of fields that are in the query */
new_num_fields = (Int2) SOCK_get_int(sock, sizeof(Int2));
mylog("num_fields = %d\n", new_num_fields);
if (self)
/* according to that allocate memory */
CI_set_num_fields(self, new_num_fields);
/* now read in the descriptions */
for (lf = 0; lf < new_num_fields; lf++)
{
SOCK_get_string(sock, new_field_name, 2 * MAX_COLUMN_LEN);
new_adtid = (Oid) SOCK_get_int(sock, 4);
new_adtsize = (Int2) SOCK_get_int(sock, 2);
/* If 6.4 protocol, then read the atttypmod field */
if (PG_VERSION_GE(conn, 6.4))
{
mylog("READING ATTTYPMOD\n");
new_atttypmod = (Int4) SOCK_get_int(sock, 4);
/* Subtract the header length */
switch (new_adtid)
{
case PG_TYPE_DATETIME:
case PG_TYPE_TIMESTAMP_NO_TMZONE:
case PG_TYPE_TIME:
case PG_TYPE_TIME_WITH_TMZONE:
break;
default:
new_atttypmod -= 4;
}
if (new_atttypmod < 0)
new_atttypmod = -1;
}
mylog("CI_read_fields: fieldname='%s', adtid=%d, adtsize=%d, atttypmod=%d\n", new_field_name, new_adtid, new_adtsize, new_atttypmod);
if (self)
CI_set_field_info(self, lf, new_field_name, new_adtid, new_adtsize, new_atttypmod);
}
return (SOCK_get_errcode(sock) == 0);
}
void
CI_free_memory(ColumnInfoClass *self)
{
register Int2 lf;
int num_fields = self->num_fields;
for (lf = 0; lf < num_fields; lf++)
{
if (self->name[lf])
{
free(self->name[lf]);
self->name[lf] = NULL;
}
}
/* Safe to call even if null */
self->num_fields = 0;
if (self->name)
free(self->name);
self->name = NULL;
if (self->adtid)
free(self->adtid);
self->adtid = NULL;
if (self->adtsize)
free(self->adtsize);
self->adtsize = NULL;
if (self->display_size)
free(self->display_size);
self->display_size = NULL;
if (self->atttypmod)
free(self->atttypmod);
self->atttypmod = NULL;
}
void
CI_set_num_fields(ColumnInfoClass *self, int new_num_fields)
{
CI_free_memory(self); /* always safe to call */
self->num_fields = new_num_fields;
self->name = (char **) malloc(sizeof(char *) * self->num_fields);
memset(self->name, 0, sizeof(char *) * self->num_fields);
self->adtid = (Oid *) malloc(sizeof(Oid) * self->num_fields);
self->adtsize = (Int2 *) malloc(sizeof(Int2) * self->num_fields);
self->display_size = (Int2 *) malloc(sizeof(Int2) * self->num_fields);
self->atttypmod = (Int4 *) malloc(sizeof(Int4) * self->num_fields);
}
void
CI_set_field_info(ColumnInfoClass *self, int field_num, char *new_name,
Oid new_adtid, Int2 new_adtsize, Int4 new_atttypmod)
{
/* check bounds */
if ((field_num < 0) || (field_num >= self->num_fields))
return;
/* store the info */
self->name[field_num] = strdup(new_name);
self->adtid[field_num] = new_adtid;
self->adtsize[field_num] = new_adtsize;
self->atttypmod[field_num] = new_atttypmod;
self->display_size[field_num] = 0;
}
/* File: columninfo.h
*
* Description: See "columninfo.c"
*
* Comments: See "notice.txt" for copyright and license information.
*
*/
#ifndef __COLUMNINFO_H__
#define __COLUMNINFO_H__
#include "psqlodbc.h"
struct ColumnInfoClass_
{
Int2 num_fields;
char **name; /* list of type names */
Oid *adtid; /* list of type ids */
Int2 *adtsize; /* list type sizes */
Int2 *display_size; /* the display size (longest row) */
Int4 *atttypmod; /* the length of bpchar/varchar */
};
#define CI_get_num_fields(self) (self->num_fields)
#define CI_get_oid(self, col) (self->adtid[col])
#define CI_get_fieldname(self, col) (self->name[col])
#define CI_get_fieldsize(self, col) (self->adtsize[col])
#define CI_get_display_size(self, col) (self->display_size[col])
#define CI_get_atttypmod(self, col) (self->atttypmod[col])
ColumnInfoClass *CI_Constructor(void);
void CI_Destructor(ColumnInfoClass *self);
void CI_free_memory(ColumnInfoClass *self);
char CI_read_fields(ColumnInfoClass *self, ConnectionClass *conn);
/* functions for setting up the fields from within the program, */
/* 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);
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* File: convert.h
*
* Description: See "convert.c"
*
* Comments: See "notice.txt" for copyright and license information.
*
*/
#ifndef __CONVERT_H__
#define __CONVERT_H__
#include "psqlodbc.h"
/* copy_and_convert results */
#define COPY_OK 0
#define COPY_UNSUPPORTED_TYPE 1
#define COPY_UNSUPPORTED_CONVERSION 2
#define COPY_RESULT_TRUNCATED 3
#define COPY_GENERAL_ERROR 4
#define COPY_NO_DATA_FOUND 5
/* convert_escape results */
#define CONVERT_ESCAPE_OK 0
#define CONVERT_ESCAPE_OVERFLOW 1
#define CONVERT_ESCAPE_ERROR -1
typedef struct
{
int infinity;
int m;
int d;
int y;
int hh;
int mm;
int ss;
int fr;
} SIMPLE_TIME;
int copy_and_convert_field_bindinfo(StatementClass *stmt, Int4 field_type, void *value, int col);
int copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2 fCType,
PTR rgbValue, SDWORD cbValueMax, SDWORD *pcbValue);
int copy_statement_with_parameters(StatementClass *stmt);
BOOL convert_money(const char *s, char *sout, size_t soutmax);
char parse_datetime(const char *buf, SIMPLE_TIME *st);
int convert_linefeeds(const char *s, char *dst, size_t max, BOOL convlf, BOOL *changed);
int convert_special_chars(const char *si, char *dst, int used, BOOL convlf,int ccsc);
int convert_pgbinary_to_char(const char *value, char *rgbValue, int cbValueMax);
int convert_from_pgbinary(const unsigned char *value, unsigned char *rgbValue, int cbValueMax);
int convert_to_pgbinary(const unsigned char *in, char *out, int len);
void encode(const char *in, char *out);
void decode(const char *in, char *out);
int convert_lo(StatementClass *stmt, const void *value, Int2 fCType, PTR rgbValue,
SDWORD cbValueMax, SDWORD *pcbValue);
#endif
/* File: descriptor.h
*
* Description: This file contains defines and declarations that are related to
* the entire driver.
*
* Comments: See "notice.txt" for copyright and license information.
*
* $Id: descriptor.h,v 1.6 2002/06/06 04:50:47 inoue Exp $
*
*/
#ifndef __DESCRIPTOR_H__
#define __DESCRIPTOR_H__
#include "psqlodbc.h"
typedef struct
{
COL_INFO *col_info; /* cached SQLColumns info for this table */
char schema[MAX_SCHEMA_LEN + 1];
char name[MAX_TABLE_LEN + 1];
char alias[MAX_TABLE_LEN + 1];
char updatable;
} TABLE_INFO;
typedef struct
{
TABLE_INFO *ti; /* resolve to explicit table names */
int column_size; /* precision in 2.x */
int decimal_digits; /* scale in 2.x */
int display_size;
int length;
int type;
char nullable;
char func;
char expr;
char quote;
char dquote;
char numeric;
char updatable;
char dot[MAX_TABLE_LEN + 1];
char name[MAX_COLUMN_LEN + 1];
char alias[MAX_COLUMN_LEN + 1];
char *schema;
} FIELD_INFO;
Int4 FI_precision(const FIELD_INFO *);
Int4 FI_scale(const FIELD_INFO *);
struct ARDFields_
{
StatementClass *stmt;
int rowset_size;
int bind_size; /* size of each structure if using Row
* Binding */
UInt2 *row_operation_ptr;
UInt4 *row_offset_ptr;
BindInfoClass *bookmark;
BindInfoClass *bindings;
int allocated;
};
struct APDFields_
{
StatementClass *stmt;
int paramset_size;
int param_bind_type; /* size of each structure if using Param
* Binding */
UInt2 *param_operation_ptr;
UInt4 *param_offset_ptr;
ParameterInfoClass *parameters;
int allocated;
};
struct IRDFields_
{
StatementClass *stmt;
UInt4 *rowsFetched;
UInt2 *rowStatusArray;
UInt4 nfields;
FIELD_INFO **fi;
};
struct IPDFields_
{
StatementClass *stmt;
UInt4 *param_processed_ptr;
UInt2 *param_status_ptr;
};
void InitializeARDFields(ARDFields *self);
void InitializeAPDFields(APDFields *self);
/* void InitializeIRDFields(IRDFields *self);
void InitializeIPDFiedls(IPDFields *self); */
void ARDFields_free(ARDFields *self);
void APDFields_free(APDFields *self);
void IRDFields_free(IRDFields *self);
void IPDFields_free(IPDFields *self);
void ARD_unbind_cols(ARDFields *self, BOOL freeall);
void APD_free_params(APDFields *self, char option);
#if (ODBCVER >= 0x0300)
void Desc_set_error(SQLHDESC hdesc, int errornumber, const char * errormsg);
#endif /* ODBCVER */
#endif
This diff is collapsed.
/* File: dlg_specific.h
*
* Description: See "dlg_specific.c"
*
* Comments: See "notice.txt" for copyright and license information.
*
*/
#ifndef __DLG_SPECIFIC_H__
#define __DLG_SPECIFIC_H__
#include "psqlodbc.h"
#include "connection.h"
#ifdef WIN32
#include <windowsx.h>
#include "resource.h"
#endif
/* Unknown data type sizes */
#define UNKNOWNS_AS_MAX 0
#define UNKNOWNS_AS_DONTKNOW 1
#define UNKNOWNS_AS_LONGEST 2
/* ODBC initialization files */
#ifndef WIN32
#define ODBC_INI ".odbc.ini"
#define ODBCINST_INI "odbcinst.ini"
#else
#define ODBC_INI "ODBC.INI"
#define ODBCINST_INI "ODBCINST.INI"
#endif
#define INI_DSN DBMS_NAME /* Name of default
* Datasource in ini
* file (not used?) */
#define INI_KDESC "Description" /* Data source
* description */
#define INI_SERVER "Servername" /* Name of Server
* running the Postgres
* service */
#define INI_PORT "Port" /* Port on which the
* Postmaster is listening */
#define INI_DATABASE "Database" /* Database Name */
#define INI_USER "Username" /* Default User Name */
#define INI_PASSWORD "Password" /* Default Password */
#define INI_DEBUG "Debug" /* Debug flag */
#define INI_FETCH "Fetch" /* Fetch Max Count */
#define INI_SOCKET "Socket" /* Socket buffer size */
#define INI_READONLY "ReadOnly" /* Database is read only */
#define INI_COMMLOG "CommLog" /* Communication to
* backend logging */
#define INI_PROTOCOL "Protocol" /* What protocol (6.2) */
#define INI_OPTIMIZER "Optimizer" /* Use backend genetic
* optimizer */
#define INI_KSQO "Ksqo" /* Keyset query
* optimization */
#define INI_CONNSETTINGS "ConnSettings" /* Anything to send to
* backend on successful
* connection */
#define INI_UNIQUEINDEX "UniqueIndex" /* Recognize unique
* indexes */
#define INI_UNKNOWNSIZES "UnknownSizes" /* How to handle unknown
* result set sizes */
#define INI_CANCELASFREESTMT "CancelAsFreeStmt"
#define INI_USEDECLAREFETCH "UseDeclareFetch" /* Use Declare/Fetch
* cursors */
/* More ini stuff */
#define INI_TEXTASLONGVARCHAR "TextAsLongVarchar"
#define INI_UNKNOWNSASLONGVARCHAR "UnknownsAsLongVarchar"
#define INI_BOOLSASCHAR "BoolsAsChar"
#define INI_MAXVARCHARSIZE "MaxVarcharSize"
#define INI_MAXLONGVARCHARSIZE "MaxLongVarcharSize"
#define INI_FAKEOIDINDEX "FakeOidIndex"
#define INI_SHOWOIDCOLUMN "ShowOidColumn"
#define INI_ROWVERSIONING "RowVersioning"
#define INI_SHOWSYSTEMTABLES "ShowSystemTables"
#define INI_LIE "Lie"
#define INI_PARSE "Parse"
#define INI_EXTRASYSTABLEPREFIXES "ExtraSysTablePrefixes"
#define INI_TRANSLATIONNAME "TranslationName"
#define INI_TRANSLATIONDLL "TranslationDLL"
#define INI_TRANSLATIONOPTION "TranslationOption"
#define INI_DISALLOWPREMATURE "DisallowPremature"
#define INI_UPDATABLECURSORS "UpdatableCursors"
#define INI_LFCONVERSION "LFConversion"
#define INI_TRUEISMINUS1 "TrueIsMinus1"
#define INI_INT8AS "BI"
/* Bit representaion for abbreviated connection strings */
#define BIT_LFCONVERSION (1L)
#define BIT_UPDATABLECURSORS (1L<<1)
#define BIT_DISALLOWPREMATURE (1L<<2)
#define BIT_UNIQUEINDEX (1L<<3)
#define BIT_PROTOCOL_63 (1L<<4)
#define BIT_PROTOCOL_64 (1L<<5)
#define BIT_UNKNOWN_DONTKNOW (1L<<6)
#define BIT_UNKNOWN_ASMAX (1L<<7)
#define BIT_OPTIMIZER (1L<<8)
#define BIT_KSQO (1L<<9)
#define BIT_COMMLOG (1L<<10)
#define BIT_DEBUG (1L<<11)
#define BIT_PARSE (1L<<12)
#define BIT_CANCELASFREESTMT (1L<<13)
#define BIT_USEDECLAREFETCH (1L<<14)
#define BIT_READONLY (1L<<15)
#define BIT_TEXTASLONGVARCHAR (1L<<16)
#define BIT_UNKNOWNSASLONGVARCHAR (1L<<17)
#define BIT_BOOLSASCHAR (1L<<18)
#define BIT_ROWVERSIONING (1L<<19)
#define BIT_SHOWSYSTEMTABLES (1L<<20)
#define BIT_SHOWOIDCOLUMN (1L<<21)
#define BIT_FAKEOIDINDEX (1L<<22)
#define BIT_TRUEISMINUS1 (1L<<23)
#define EFFECTIVE_BIT_COUNT 24
/* Connection Defaults */
#define DEFAULT_PORT "5432"
#define DEFAULT_READONLY 0
#define DEFAULT_PROTOCOL "6.4" /* the latest protocol is
* the default */
#define DEFAULT_USEDECLAREFETCH 0
#define DEFAULT_TEXTASLONGVARCHAR 1
#define DEFAULT_UNKNOWNSASLONGVARCHAR 0
#define DEFAULT_BOOLSASCHAR 1
#define DEFAULT_OPTIMIZER 1 /* disable */
#define DEFAULT_KSQO 1 /* on */
#define DEFAULT_UNIQUEINDEX 1 /* dont recognize */
#define DEFAULT_COMMLOG 0 /* dont log */
#define DEFAULT_DEBUG 0
#define DEFAULT_UNKNOWNSIZES UNKNOWNS_AS_MAX
#define DEFAULT_FAKEOIDINDEX 0
#define DEFAULT_SHOWOIDCOLUMN 0
#define DEFAULT_ROWVERSIONING 0
#define DEFAULT_SHOWSYSTEMTABLES 0 /* dont show system tables */
#define DEFAULT_LIE 0
#define DEFAULT_PARSE 0
#define DEFAULT_CANCELASFREESTMT 0
#define DEFAULT_EXTRASYSTABLEPREFIXES "dd_;"
#define DEFAULT_DISALLOWPREMATURE 0
#define DEFAULT_TRUEISMINUS1 0
#ifdef DRIVER_CURSOR_IMPLEMENT
#define DEFAULT_UPDATABLECURSORS 1
#else
#define DEFAULT_UPDATABLECURSORS 0
#endif /* DRIVER_CURSOR_IMPLEMENT */
#ifdef WIN32
#define DEFAULT_LFCONVERSION 1
#else
#define DEFAULT_LFCONVERSION 0
#endif /* WIN32 */
#define DEFAULT_INT8AS 0
/* prototypes */
void getCommonDefaults(const char *section, const char *filename, ConnInfo *ci);
#ifdef WIN32
void SetDlgStuff(HWND hdlg, const ConnInfo *ci);
void GetDlgStuff(HWND hdlg, ConnInfo *ci);
int CALLBACK driver_optionsProc(HWND hdlg,
UINT wMsg,
WPARAM wParam,
LPARAM lParam);
int CALLBACK global_optionsProc(HWND hdlg,
UINT wMsg,
WPARAM wParam,
LPARAM lParam);
int CALLBACK ds_options1Proc(HWND hdlg,
UINT wMsg,
WPARAM wParam,
LPARAM lParam);
int CALLBACK ds_options2Proc(HWND hdlg,
UINT wMsg,
WPARAM wParam,
LPARAM lParam);
#endif /* WIN32 */
void updateGlobals(void);
void writeDriverCommoninfo(const ConnInfo *ci);
void writeDSNinfo(const ConnInfo *ci);
void getDSNdefaults(ConnInfo *ci);
void getDSNinfo(ConnInfo *ci, char overwrite);
void makeConnectString(char *connect_string, const ConnInfo *ci, UWORD);
void copyAttributes(ConnInfo *ci, const char *attribute, const char *value);
void copyCommonAttributes(ConnInfo *ci, const char *attribute, const char *value);
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* File: environ.h
*
* Description: See "environ.c"
*
* Comments: See "notice.txt" for copyright and license information.
*
*/
#ifndef __ENVIRON_H__
#define __ENVIRON_H__
#include "psqlodbc.h"
#define ENV_ALLOC_ERROR 1
/********** Environment Handle *************/
struct EnvironmentClass_
{
char *errormsg;
int errornumber;
Int4 flag;
};
/* Environment prototypes */
EnvironmentClass *EN_Constructor(void);
char EN_Destructor(EnvironmentClass *self);
char EN_get_error(EnvironmentClass *self, int *number, char **message);
char EN_add_connection(EnvironmentClass *self, ConnectionClass *conn);
char EN_remove_connection(EnvironmentClass *self, ConnectionClass *conn);
void EN_log_error(char *func, char *desc, EnvironmentClass *self);
#define EN_OV_ODBC2 1L
#define EN_is_odbc2(env) ((env->flag & EN_OV_ODBC2) != 0)
#define EN_is_odbc3(env) ((env->flag & EN_OV_ODBC2) == 0)
#define EN_set_odbc2(env) (env->flag |= EN_OV_ODBC2)
#define EN_set_odbc3(env) (env->flag &= EN_OV_ODBC2)
#endif
This diff is collapsed.
This diff is collapsed.
/* GetPrivateProfileString
* for UNIX use
*/
#ifndef GPPS_H
#define GPPS_H
#include "psqlodbc.h"
#ifndef WIN32
#include <sys/types.h>
#endif
#define SQLGetPrivateProfileString(a,b,c,d,e,f) GetPrivateProfileString(a,b,c,d,e,f)
#define SQLWritePrivateProfileString(a,b,c,d) WritePrivateProfileString(a,b,c,d)
#ifdef __cplusplus
extern "C"
{
#endif
DWORD
GetPrivateProfileString(const char *theSection, /* section name */
const char *theKey, /* search key name */
const char *theDefault, /* default value if not
* found */
char *theReturnBuffer, /* return valuse stored
* here */
size_t theBufferLength, /* byte length of return
* buffer */
const char *theIniFileName); /* pathname of ini file
* to search */
DWORD
WritePrivateProfileString(const char *theSection, /* section name */
const char *theKey, /* write key name */
const char *theBuffer, /* input buffer */
const char *theIniFileName); /* pathname of ini file
* to write */
#ifdef __cplusplus
}
#endif
#ifndef WIN32
#undef DWORD
#endif
#endif
This diff is collapsed.
This diff is collapsed.
#ifndef _IODBC_H
#define _IODBC_H
#if !defined(WIN32) && !defined(WIN32_SYSTEM)
#define _UNIX_
#include <stdlib.h>
#include <sys/types.h>
#define MEM_ALLOC(size) (malloc((size_t)(size)))
#define MEM_FREE(ptr) \
do { \
if(ptr) \
free(ptr); \
} while (0)
#define STRCPY(t, s) (strcpy((char*)(t), (char*)(s)))
#define STRNCPY(t,s,n) (strncpy((char*)(t), (char*)(s), (size_t)(n)))
#define STRCAT(t, s) (strcat((char*)(t), (char*)(s)))
#define STRNCAT(t,s,n) (strncat((char*)(t), (char*)(s), (size_t)(n)))
#define STREQ(a, b) (strcmp((char*)(a), (char*)(b)) == 0)
#define STRLEN(str) ((str)? strlen((char*)(str)):0)
#define EXPORT
#define CALLBACK
#define FAR
typedef signed short SSHOR;
typedef short WORD;
typedef long DWORD;
typedef WORD WPARAM;
typedef DWORD LPARAM;
typedef void *HWND;
typedef int BOOL;
#endif /* _UNIX_ */
#if defined(WIN32) || defined(WIN32_SYSTEM)
#include <windows.h>
#include <windowsx.h>
#ifdef _MSVC_
#define MEM_ALLOC(size) (fmalloc((size_t)(size)))
#define MEM_FREE(ptr) ((ptr)? ffree((PTR)(ptr)):0))
#define STRCPY(t, s) (fstrcpy((char FAR*)(t), (char FAR*)(s)))
#define STRNCPY(t,s,n) (fstrncpy((char FAR*)(t), (char FAR*)(s), (size_t)(n)))
#define STRLEN(str) ((str)? fstrlen((char FAR*)(str)):0)
#define STREQ(a, b) (fstrcmp((char FAR*)(a), (char FAR*)(b) == 0)
#endif
#ifdef _BORLAND_
#define MEM_ALLOC(size) (farmalloc((unsigned long)(size))
#define MEM_FREE(ptr) ((ptr)? farfree((void far*)(ptr)):0)
#define STRCPY(t, s) (_fstrcpy((char FAR*)(t), (char FAR*)(s)))
#define STRNCPY(t,s,n) (_fstrncpy((char FAR*)(t), (char FAR*)(s), (size_t)(n)))
#define STRLEN(str) ((str)? _fstrlen((char FAR*)(str)):0)
#define STREQ(a, b) (_fstrcmp((char FAR*)(a), (char FAR*)(b) == 0)
#endif
#endif /* WIN32 */
#define SYSERR (-1)
#ifndef NULL
#define NULL ((void FAR*)0UL)
#endif
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* File: lobj.h
*
* Description: See "lobj.c"
*
* Comments: See "notice.txt" for copyright and license information.
*
*/
#ifndef __LOBJ_H__
#define __LOBJ_H__
#include "psqlodbc.h"
struct lo_arg
{
int isint;
int len;
union
{
int integer;
char *ptr;
} u;
};
#define LO_CREAT 957
#define LO_OPEN 952
#define LO_CLOSE 953
#define LO_READ 954
#define LO_WRITE 955
#define LO_LSEEK 956
#define LO_TELL 958
#define LO_UNLINK 964
#define INV_WRITE 0x00020000
#define INV_READ 0x00040000
Oid lo_creat(ConnectionClass *conn, int mode);
int lo_open(ConnectionClass *conn, int lobjId, int mode);
int lo_close(ConnectionClass *conn, int fd);
int lo_read(ConnectionClass *conn, int fd, char *buf, int len);
int lo_write(ConnectionClass *conn, int fd, char *buf, int len);
int lo_lseek(ConnectionClass *conn, int fd, int offset, int len);
int lo_tell(ConnectionClass *conn, int fd);
int lo_unlink(ConnectionClass *conn, Oid lobjId);
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
[PostgreSQL]
Debug = 0
CommLog = 1
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI]
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers]
"PostgreSQL"="Installed"
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\PostgreSQL]
"APILevel"="1"
"ConnectFunctions"="YYN"
"Driver"="PSQLODBC.DLL"
"DriverODBCVer"="02.50"
"FileUsage"="0"
"Setup"="PSQLODBC.DLL"
"SQLLevel"="1"
"UsageCount"=dword:00000001
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI]
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers]
"PostgreSQL+ (Beta)"="Installed"
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\PostgreSQL+ (Beta)]
"APILevel"="1"
"ConnectFunctions"="YYN"
"Driver"="PSQLODBC30.DLL"
"DriverODBCVer"="03.00"
"FileUsage"="0"
"Setup"="PSQLODBC30.DLL"
"SQLLevel"="1"
"UsageCount"=dword:00000001
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment