Move contrib/odbc/odbc.sql together with odbc driver, remove old files;
authorPeter Eisentraut
Mon, 18 Sep 2000 20:11:37 +0000 (20:11 +0000)
committerPeter Eisentraut
Mon, 18 Sep 2000 20:11:37 +0000 (20:11 +0000)
revise ODBC "installation instructions"; update some other outdated
documentation; update contrib documentation

14 files changed:
contrib/Contrib.index [deleted file]
contrib/Makefile
contrib/README
contrib/mac/README.mac [new file with mode: 0644]
contrib/odbc/Makefile [deleted file]
contrib/odbc/README.odbc [deleted file]
contrib/odbc/odbc-pre7.source [deleted file]
contrib/odbc/odbc.c [deleted file]
doc/src/sgml/ecpg.sgml
doc/src/sgml/geqo.sgml
doc/src/sgml/odbc.sgml
doc/src/sgml/page.sgml
src/interfaces/odbc/GNUmakefile
src/interfaces/odbc/odbc.sql [moved from contrib/odbc/odbc.sql with 95% similarity]

diff --git a/contrib/Contrib.index b/contrib/Contrib.index
deleted file mode 100644 (file)
index fe18312..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-
-The PostgreSQL contrib:
-~~~~~~~~~~~~~~~~~~~~~~
-
-tips/apache_logging -
-   Getting Apache to log to PostgreSQL
-   by Terry Mackintosh 
-
-array -
-   Array iterator functions
-   by Massimo Dal Zotto 
-
-earthdistance -
-   Operator for computing earth distance for two points
-   by Hal Snyder 
-
-findoidjoins -
-   Finds the joins used by oid columns by examining the actual
-   values in the oid columns and row oids.
-   by Bruce Momjian 
-
-fulltextindex -
-   Full text indexing using triggers
-   by Maarten Boekhold 
-
-isbn_issn -
-   PostgreSQL type extensions for ISBN (books) and ISSN (serials)
-   by Garrett A. Wollman 
-
-linux -
-   Start postgres back end system
-   by Thomas Lockhart 
-
-lo -
-   Large Object maintenance
-   by Peter Mount  
-
-miscutil -
-   Postgres assert checking and various utility functions
-   by Dal Zotto 
-
-mSQL-interface -
-   mSQL API translation library
-   by Aldrin Leal 
-
-noupdate -
-   trigger to prevent updates on single columns
-   
-
-pg_dumplo -
-   Dump large objects
-   by Karel Zak 
-
-soundex -
-   Prototype for soundex function
-
-spi -
-   A general trigger function autoinc() and so on.
-
-string -
-   C-like input/output conversion routines for strings
-   by Massimo Dal Zotto 
-
-tools -
-   Assorted developer tools
-   by Massimo Dal Zotto 
-
-unixdate -
-   Conversions from integer to datetime
-   by Thomas Lockhart 
-
-userlock -
-   User locks
-   by Massimo Dal Zotto 
-
-vacuumlo -
-   Remove orphaned large objects
-   by Peter T Mount 
-
-pgbench -
-   TPC-B like benchmarking tool
-   by Tatsuo Ishii 
index 411979e9eb84dddeaf3024593d85ef4c1183f665..a1adaa048cf6d5abd84d6da2b3a0cd6dd7367669 100644 (file)
@@ -1,12 +1,8 @@
-#
-# The PostgreSQL contrib tree Makefile
-#
-# $Header: /cvsroot/pgsql/contrib/Makefile,v 1.7 2000/07/16 14:50:29 petere Exp $
-#
+# $Header: /cvsroot/pgsql/contrib/Makefile,v 1.8 2000/09/18 20:11:34 petere Exp $
 
 subdir = contrib
 top_builddir = ..
-include ../src/Makefile.global
+include $(top_builddir)/src/Makefile.global
 
 WANTED_DIRS =  array       \
        earthdistance   \
@@ -16,6 +12,7 @@ WANTED_DIRS = array       \
        linux       \
        lo      \
        mSQL-interface  \
+       mac     \
        miscutil    \
        noupdate    \
        pg_dumplo   \
@@ -27,19 +24,10 @@ WANTED_DIRS =   array       \
        unixdate    \
        userlock    \
        vacuumlo    
-   #   odbc
 
 all install installdirs uninstall clean distclean maintainer-clean:
    for dir in $(WANTED_DIRS); do \
        if [ -e $$dir/Makefile ]; then \
-       $(MAKE) -C $$dir $@ ; \
+       $(MAKE) -C $$dir $@; \
        fi; \
    done
-
-install:
-   for dir in $(WANTED_DIRS); do \
-       if [ -e $$dir/Makefile ]; then \
-       $(MAKE) -C $$dir $@ ; \
-       fi; \
-   done
-   $(INSTALL_DATA) Contrib.index $(docdir)/contrib
index 23cfe8c4d29e612fa2902686b3e0147201a88fa5..0187c2ae5b6f139e50a76b6ac20302fcae38bf82 100644 (file)
+The PostgreSQL contrib tree
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
- The PostgreSQL contrib tree
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+This subtree contains tools, modules, and examples that are not
+maintained as part of the core PostgreSQL system, mainly because
+they only address a limited audience or are too inelegant to be
+sold as an official feature.  That, however, does not preclude
+their usefulness.
 
-   FIXME:
-       odbc
-       spi/preprocessor
-       tools       
+Each subdirectory contains a README file with information about the
+module.  Most items can be built with `gmake all' and installed
+with `gmake install' in the usual fashion, after you have run the
+`configure' script in the top-level directory.  Some directories
+supply new user-defined functions, operators, or types.  After you
+have installed the files you need to register the new entities in
+the database system by running the commands in the supplied .sql
+file.  For example,
 
- - the contrib contain is in the "Contrib.index"   
+   $ psql -d dbname -f module.sql
 
- - in each directory must be Makefile, possible Makefile template
-   is below this text,
+See the PostgreSQL documentation for more information about this
+procedure.
 
---------
-#
-# $Header: /cvsroot/pgsql/contrib/README,v 1.19 2000/06/19 13:52:59 momjian Exp $
-#
 
-TOPDIR=../..
+Index:
+------
 
-include ../Makefile.global
+array -
+   Array iterator functions
+   by Massimo Dal Zotto 
 
-NAME   = some_name
+earthdistance -
+   Operator for computing earth distance for two points
+   by Hal Snyder 
 
-PROGRAM    = 
-OBJS   = $(NAME).o
-DOCS   = $(NAME).doc
-SQLS   = $(NAME).sql
-BINS   =
-EXAMPLES=
-MODS   = $(NAME)$(DLSUFFIX)
+findoidjoins -
+   Finds the joins used by oid columns by examining the actual
+   values in the oid columns and row oids.
+   by Bruce Momjian 
 
-CFLAGS += -I. $(CFLAGS_SL)
+fulltextindex -
+   Full text indexing using triggers
+   by Maarten Boekhold 
 
-OTHER_CLEAN = $(SQLS)
+isbn_issn -
+   PostgreSQL type extensions for ISBN (books) and ISSN (serials)
+   by Garrett A. Wollman 
 
-all: $(MODS) $(SQLS)
+linux -
+   Scripts for starting and stopping the PostgreSQL server on
+   a Linux system
+   by Thomas Lockhart 
 
-%.sql: %.sql.in
-   $(SED) "s|MODULE_PATHNAME|$(CONTRIB_MODDIR)/$@|" < $< > $@
+lo -
+   Large Object maintenance
+   by Peter Mount  
 
+mSQL-interface -
+   mSQL API translation library
+   by Aldrin Leal 
 
-install: install_doc install_sql install_mod install_bin install_example
+mac -
+   Support functions for MAC address types
+   by Lawrence E. Rosenman 
 
-install_doc:
-   for inst_file in $(DOCS); do \
-       $(INSTALL) $(INSTL_LIB_OPTS) $$inst_file $(CONTRIB_DOCDIR); \
-   done
+miscutil -
+   PostgreSQL assert checking and various utility functions
+   by Massimo Dal Zotto 
 
-install_sql:
-   for inst_file in $(SQLS); do \
-       $(INSTALL) $(INSTL_LIB_OPTS) $$inst_file $(CONTRIB_SQLDIR); \
-   done
+noupdate -
+   trigger to prevent updates on single columns
 
-install_mod:
-   for inst_file in $(MODS); do \
-       $(INSTALL) $(INSTL_SHLIB_OPTS) $$inst_file $(CONTRIB_MODDIR); \
-   done
+pgbench -
+   TPC-B like benchmarking tool
+   by Tatsuo Ishii 
 
-install_bin:
-   for inst_file in $(BINS); do \
-       $(INSTALL) $(INSTL_EXE_OPTS) $$inst_file $(CONTRIB_BINDIR); \
-   done
+pg_dumplo -
+   Dump large objects
+   by Karel Zak 
 
-install_example:
-   for inst_file in $(EXAMPLES); do \
-       $(INSTALL) $(INSTL_LIB_OPTS) $$inst_file $(CONTRIB_EXAMPLESDIR); \
-   done
+soundex -
+   Soundex function
 
-depend dep:
-   $(CC) -MM -MG $(CFLAGS) *.c > depend
+spi -
+   Various trigger functions, examples for using SPI.
 
-clean:
-   $(RM) *~ $(OBJS) $(MODS) $(PROGRAM) depend $(OTHER_CLEAN) core log
+string -
+   C-like input/output conversion routines for strings
+   by Massimo Dal Zotto 
 
-ifeq (depend,$(wildcard depend))
-include depend
-endif
------------
-  
\ No newline at end of file
+tips/apache_logging -
+   Getting Apache to log to PostgreSQL
+   by Terry Mackintosh 
+
+tools -
+   Assorted developer tools
+   by Massimo Dal Zotto 
+
+unixdate -
+   Conversions from integer to datetime
+   by Thomas Lockhart 
+
+userlock -
+   User locks
+   by Massimo Dal Zotto 
+
+vacuumlo -
+   Remove orphaned large objects
+   by Peter T Mount 
diff --git a/contrib/mac/README.mac b/contrib/mac/README.mac
new file mode 100644 (file)
index 0000000..f68a5fa
--- /dev/null
@@ -0,0 +1,8 @@
+This directory contains tools to create a mapping table from MAC
+addresses (e.g., Ethernet hardware addresses) to human-readable
+manufacturer strings.  The `createoui' script builds the table
+structure, `updateoui' obtains the current official mapping table
+from the web site of the IEEE, converts it, and stores it in the
+database, `dropoui' removes everything.  Use the --help option to
+get more usage information from the respective script.  All three
+use the psql program; any extra arguments will be passed to psql.
diff --git a/contrib/odbc/Makefile b/contrib/odbc/Makefile
deleted file mode 100644 (file)
index e81f51f..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-# ODBC extensions
-# Thomas Lockhart 2000-04-03
-
-subdir = contrib/odbc
-top_builddir = ../..
-include $(top_builddir)/src/Makefile.global
-
-ifndef PGLIB
-  PGLIB= .
-endif
-
-CFLAGS+= $(CFLAGS_SL)
-
-TARGETS_7= odbc.sql
-TARGETS_PRE7= odbc$(DLSUFFIX) odbc-pre7.sql
-
-TARGETS= $(TARGETS_7)
-
-CLEANFILES+= $(TARGETS) $(TARGETS_PRE7)
-
-all: $(TARGETS)
-
-install: all
-ifneq ($(filter odbc$(DLSUFFIX), $(TARGETS)),)
-   -test -d $(PGLIB) || $(INSTALL) -d $(PGLIB)
-   $(INSTALL) odbc$(DLSUFFIX) $(PGLIB)
-endif
-
-pre7:
-   $(MAKE) TARGETS="$(TARGETS) $(TARGETS_PRE7)"
-
-install-pre7:
-   $(MAKE) TARGETS="$(TARGETS) $(TARGETS_PRE7)" install
-
-odbc-pre7.sql: odbc-pre7.source odbc.sql
-   rm -f $@; \
-   cat $^ \
-   | sed -e "s:_OBJWD_:$(PGLIB):g" \
-         -e "s:_DLSUFFIX_:$(DLSUFFIX):g" \
-         -e "s:float(15):float8:g" > $@
-
-%.sql: %.source
-   rm -f $@; \
-   sed -e "s:_OBJWD_:$(PGLIB):g" \
-       -e "s:_DLSUFFIX_:$(DLSUFFIX):g" < $< > $@
-
-clean:
-   rm -f $(TARGETS) *.o
diff --git a/contrib/odbc/README.odbc b/contrib/odbc/README.odbc
deleted file mode 100644 (file)
index c36f183..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-This directory contains support functions for the ODBC driver
-supplied with PostgreSQL-7.0.
-
-To enable additional ODBC functions with PostgreSQL-7.0, simply
-execute the commands in odbc.sql:
-
-psql
-Welcome to psql, the PostgreSQL interactive terminal.
-
-Type:  \copyright for distribution terms
-       \h for help with SQL commands
-       \? for help on internal slash commands
-       \g or terminate with semicolon to execute query
-       \q to quit
-
-postgres=# \i odbc.sql
-CREATE
-...
-
-
-To enable additional ODBC functions with versions of PostgreSQL
-prior to PostgreSQL-7.0 (e.g. PostgreSQL-6.5.3), build the shared
-library and SQL commands as follows:
-
-make pre7
-psql
-Welcome to psql, the PostgreSQL interactive terminal.
-
-Type:  \copyright for distribution terms
-       \h for help with SQL commands
-       \? for help on internal slash commands
-       \g or terminate with semicolon to execute query
-       \q to quit
-
-postgres=# \i odbc-pre7.sql
-CREATE
-...
-
diff --git a/contrib/odbc/odbc-pre7.source b/contrib/odbc/odbc-pre7.source
deleted file mode 100644 (file)
index 4fa06c4..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
--- ODBC-pre7.sql
---
--- Use float8 rather than float(15) since pre-7.0 does not accept
--- SQL92 type names of this form in the CREATE FUNCTION command.
---
-
---
--- Character string manipulation
---
-
---
--- Compatibility functions for pre-v7.0.
--- These should be applied to pre-v7.0 databases
--- when using the v7.0 ODBC driver.
---
-
-CREATE FUNCTION char_length(text)
-    RETURNS integer
-    AS 'SELECT length(CAST($1 AS text))'
-    LANGUAGE 'SQL';
-
-CREATE FUNCTION pow(float8)
-    RETURNS float8
-    AS 'SELECT dpow($1)'
-    LANGUAGE 'SQL';
-
---
--- Extensions for ODBC compliance in v7.0.
--- In the current driver, ODBC functions must map directly into a
--- Postgres function. So in some cases we must create a compatible
--- function.
---
-
-CREATE FUNCTION ascii(text)
-    RETURNS integer
-    AS '_OBJWD_/odbc_DLSUFFIX_', 'ascii'
-    LANGUAGE 'C';
-
-CREATE FUNCTION ichar(integer)
-    RETURNS char(1)
-    AS '_OBJWD_/odbc_DLSUFFIX_', 'ichar'
-    LANGUAGE 'C';
-
-CREATE FUNCTION insert(text, integer, integer, text)
-    RETURNS text
-    AS '_OBJWD_/odbc_DLSUFFIX_', 'insert'
-    LANGUAGE 'C';
-
--- replace all occurences of $2 with $3
-CREATE FUNCTION replace(text, text, text)
-    RETURNS text
-    AS '_OBJWD_/odbc_DLSUFFIX_', 'replace'
-    LANGUAGE 'C';
-
--- return the string repeated n times
-CREATE FUNCTION repeat(text, integer)
-    RETURNS text
-    AS '_OBJWD_/odbc_DLSUFFIX_', 'repeat'
-    LANGUAGE 'C';
-
---
--- Mathematical functions for pre-v7.0
---
-
-CREATE FUNCTION dround(float8)
-    RETURNS float8
-    AS '_OBJWD_/odbc_DLSUFFIX_', 'dround'
-    LANGUAGE 'C';
-
-CREATE FUNCTION round(float8)
-    RETURNS float8
-    AS 'SELECT dround($1)'
-    LANGUAGE 'SQL';
-
---
--- Math functions present in backend, but not in catalog for v7.0
---
-
-CREATE FUNCTION acos(float8)
-    RETURNS float8
-    AS '_OBJWD_/odbc_DLSUFFIX_', 'dacos'
-    LANGUAGE 'C';
-
-CREATE FUNCTION asin(float8)
-    RETURNS float8
-    AS '_OBJWD_/odbc_DLSUFFIX_', 'dasin'
-    LANGUAGE 'C';
-
-CREATE FUNCTION atan(float8)
-    RETURNS float8
-    AS '_OBJWD_/odbc_DLSUFFIX_', 'datan'
-    LANGUAGE 'C';
-
-CREATE FUNCTION atan2(float8,float8)
-    RETURNS float8
-    AS '_OBJWD_/odbc_DLSUFFIX_', 'datan2'
-    LANGUAGE 'C';
-
-CREATE FUNCTION cos(float8)
-    RETURNS float8
-    AS '_OBJWD_/odbc_DLSUFFIX_', 'dcos'
-    LANGUAGE 'C';
-
-CREATE FUNCTION cot(float8)
-    RETURNS float8
-    AS '_OBJWD_/odbc_DLSUFFIX_', 'dcot'
-    LANGUAGE 'C';
-
-CREATE FUNCTION sin(float8)
-    RETURNS float8
-    AS '_OBJWD_/odbc_DLSUFFIX_', 'dsin'
-    LANGUAGE 'C';
-
-CREATE FUNCTION dtan(float8)
-    RETURNS float8
-    AS '_OBJWD_/odbc_DLSUFFIX_', 'dtan'
-    LANGUAGE 'C';
-
-CREATE FUNCTION degrees(float8)
-    RETURNS float8
-    AS '_OBJWD_/odbc_DLSUFFIX_', 'degrees'
-    LANGUAGE 'C';
-
-CREATE FUNCTION pi()
-    RETURNS float8
-    AS '_OBJWD_/odbc_DLSUFFIX_', 'dpi'
-    LANGUAGE 'C';
-
-CREATE FUNCTION radians(float8)
-    RETURNS float8
-    AS '_OBJWD_/odbc_DLSUFFIX_', 'radians'
-    LANGUAGE 'C';
-
--- random number generator currently requires RAND_MAX be available
-CREATE FUNCTION random()
-    RETURNS float8
-    AS '_OBJWD_/odbc_DLSUFFIX_', 'drandom'
-    LANGUAGE 'C';
-
-CREATE FUNCTION truncate(numeric,integer)
-    RETURNS numeric
-    AS 'SELECT trunc($1, $2)'
-    LANGUAGE 'SQL';
-
---
--- Date/time functions for v7.0
---
-
-CREATE FUNCTION interval_mul(interval,float8)
-    RETURNS interval
-    AS '_OBJWD_/odbc_DLSUFFIX_'
-    LANGUAGE 'C';
-
-CREATE OPERATOR * (
-    LEFTARG = interval,
-    RIGHTARG = float8,
-    PROCEDURE = interval_mul
-);
-
-
-
-
diff --git a/contrib/odbc/odbc.c b/contrib/odbc/odbc.c
deleted file mode 100644 (file)
index 2a134ee..0000000
+++ /dev/null
@@ -1,403 +0,0 @@
-#include "postgres.h"
-
-#include 
-#include 
-#include 
-#include              /* faked on sunos4 */
-#include 
-#include 
-
-#include "fmgr.h"
-#include "utils/timestamp.h"
-#include "utils/builtins.h"
-
-
-int4 ascii(text *string);
-text *ichar(int4 cvalue);
-text *repeat(text *string, int4 count);
-Interval *interval_mul(Interval *span1, float8 *arg2);
-float64 dasin(float64 arg1);
-float64 datan(float64 arg1);
-float64 datan2(float64 arg1, float64 arg2);
-float64 dcos(float64 arg1);
-float64 dcot(float64 arg1);
-float64 dsin(float64 arg1);
-float64 dtan(float64 arg1);
-float64 degrees(float64 arg1);
-float64 dpi(void);
-float64 radians(float64 arg1);
-float64 drandom(void);
-void setseed(int32 seed);
-
-
-int4
-ascii(text *string)
-{
-   if (!PointerIsValid(string))
-       return 0;
-
-   if (VARSIZE(string) <= VARHDRSZ)
-       return 0;
-
-   return ((int) *(VARDATA(string)));
-} /* ascii() */
-
-
-text *
-ichar(int4 cvalue)
-{
-   text   *result;
-
-   result = (text *) palloc(VARHDRSZ + 1);
-   VARSIZE(result) = VARHDRSZ + 1;
-   *VARDATA(result) = (char) cvalue;
-
-   return result;
-} /* ichar() */
-
-
-text *
-repeat(text *string, int4 count)
-{
-   text   *result;
-   int     slen, tlen;
-   int     i;
-   char   *cp;
-
-   if (count < 0)
-       count = 0;
-
-   slen = (VARSIZE(string)-VARHDRSZ);
-   tlen = (VARHDRSZ + (count * slen));
-
-   result = (text *) palloc(tlen);
-
-   VARSIZE(result) = tlen;
-   cp = VARDATA(result);
-   for (i = 0; i < count; i++)
-   {
-       memcpy(cp, VARDATA(string), slen);
-       cp += slen;
-   }
-
-   return result;
-} /* ichar() */
-
-Interval   *
-interval_mul(Interval *span1, float8 *arg2)
-{
-   Interval   *result;
-   double      months;
-
-   if ((!PointerIsValid(span1)) || (!PointerIsValid(arg2)))
-       return NULL;
-
-   if (!PointerIsValid(result = palloc(sizeof(Interval))))
-       elog(ERROR, "Memory allocation failed, can't divide intervals");
-
-   months = (span1->month * *arg2);
-   result->month = rint(months);
-   result->time = JROUND(span1->time * *arg2);
-   result->time += JROUND((months - result->month) * 30);
-
-   return result;
-}  /* interval_mul() */
-
-/*
- *     dasin           - returns a pointer to the arcsin of arg1 (radians)
- */
-float64
-dasin(float64 arg1)
-{
-   float64     result;
-   double      tmp;
-
-   if (!PointerIsValid(arg1))
-       return (float64) NULL;
-
-   result = (float64) palloc(sizeof(float64data));
-
-   tmp = *arg1;
-   errno = 0;
-   *result = (float64data) asin(tmp);
-   if (errno != 0
-#ifdef HAVE_FINITE
-       || !finite(*result)
-#endif
-       )
-       elog(ERROR, "dasin(%f) input is out of range", *arg1);
-
-   CheckFloat8Val(*result);
-   return result;
-} /* dasin() */
-
-
-/*
- *     datan           - returns a pointer to the arctan of arg1 (radians)
- */
-float64
-datan(float64 arg1)
-{
-   float64     result;
-   double      tmp;
-
-   if (!PointerIsValid(arg1))
-       return (float64) NULL;
-
-   result = (float64) palloc(sizeof(float64data));
-
-   tmp = *arg1;
-   errno = 0;
-   *result = (float64data) atan(tmp);
-   if (errno != 0
-#ifdef HAVE_FINITE
-       || !finite(*result)
-#endif
-       )
-       elog(ERROR, "atan(%f) input is out of range", *arg1);
-
-   CheckFloat8Val(*result);
-   return result;
-} /* datan() */
-
-
-/*
- *     atan2           - returns a pointer to the arctan2 of arg1 (radians)
- */
-float64
-datan2(float64 arg1, float64 arg2)
-{
-   float64     result;
-
-   if (!PointerIsValid(arg1) || !PointerIsValid(arg1))
-       return (float64) NULL;
-
-   result = (float64) palloc(sizeof(float64data));
-
-   errno = 0;
-   *result = (float64data) atan2(*arg1, *arg2);
-   if (errno != 0
-#ifdef HAVE_FINITE
-       || !finite(*result)
-#endif
-       )
-       elog(ERROR, "atan2(%f,%f) input is out of range", *arg1, *arg2);
-
-   CheckFloat8Val(*result);
-   return result;
-} /* datan2() */
-
-
-/*
- *     dcos            - returns a pointer to the cosine of arg1 (radians)
- */
-float64
-dcos(float64 arg1)
-{
-   float64     result;
-   double      tmp;
-
-   if (!PointerIsValid(arg1))
-       return (float64) NULL;
-
-   result = (float64) palloc(sizeof(float64data));
-
-   tmp = *arg1;
-   errno = 0;
-   *result = (float64data) cos(tmp);
-   if (errno != 0
-#ifdef HAVE_FINITE
-       || !finite(*result)
-#endif
-       )
-       elog(ERROR, "dcos(%f) input is out of range", *arg1);
-
-   CheckFloat8Val(*result);
-   return result;
-} /* dcos() */
-
-
-/*
- *     dcot            - returns a pointer to the cotangent of arg1 (radians)
- */
-float64
-dcot(float64 arg1)
-{
-   float64     result;
-   double      tmp;
-
-   if (!PointerIsValid(arg1))
-       return (float64) NULL;
-
-   result = (float64) palloc(sizeof(float64data));
-
-   tmp = *arg1;
-   errno = 0;
-   *result = (float64data) tan(tmp);
-   if ((errno != 0) || (*result == 0.0)
-#ifdef HAVE_FINITE
-       || !finite(*result)
-#endif
-       )
-       elog(ERROR, "dcot(%f) input is out of range", *arg1);
-
-   *result = 1.0/(*result);
-   CheckFloat8Val(*result);
-   return result;
-} /* dcot() */
-
-
-/*
- *     dsin            - returns a pointer to the sine of arg1 (radians)
- */
-float64
-dsin(float64 arg1)
-{
-   float64     result;
-   double      tmp;
-
-   if (!PointerIsValid(arg1))
-       return (float64) NULL;
-
-   result = (float64) palloc(sizeof(float64data));
-
-   tmp = *arg1;
-   errno = 0;
-   *result = (float64data) sin(tmp);
-   if (errno != 0
-#ifdef HAVE_FINITE
-       || !finite(*result)
-#endif
-       )
-       elog(ERROR, "dsin(%f) input is out of range", *arg1);
-
-   CheckFloat8Val(*result);
-   return result;
-} /* dsin() */
-
-
-/*
- *     dtan            - returns a pointer to the tangent of arg1 (radians)
- */
-float64
-dtan(float64 arg1)
-{
-   float64     result;
-   double      tmp;
-
-   if (!PointerIsValid(arg1))
-       return (float64) NULL;
-
-   result = (float64) palloc(sizeof(float64data));
-
-   tmp = *arg1;
-   errno = 0;
-   *result = (float64data) tan(tmp);
-   if (errno != 0
-#ifdef HAVE_FINITE
-       || !finite(*result)
-#endif
-       )
-       elog(ERROR, "dtan(%f) input is out of range", *arg1);
-
-   CheckFloat8Val(*result);
-   return result;
-} /* dtan() */
-
-
-#ifndef M_PI
-/* from my RH5.2 gcc math.h file - thomas 2000-04-03 */
-#define M_PI 3.14159265358979323846
-#endif
-
-
-/*
- *     degrees     - returns a pointer to degrees converted from radians
- */
-float64
-degrees(float64 arg1)
-{
-   float64     result;
-
-   if (!arg1)
-       return (float64) NULL;
-
-   result = (float64) palloc(sizeof(float64data));
-
-   *result = ((*arg1) * (180.0 / M_PI));
-
-   CheckFloat8Val(*result);
-   return result;
-} /* degrees() */
-
-
-/*
- *     dpi             - returns a pointer to degrees converted to radians
- */
-float64
-dpi(void)
-{
-   float64     result;
-
-   result = (float64) palloc(sizeof(float64data));
-
-   *result = (M_PI);
-
-   return result;
-} /* dpi() */
-
-
-/*
- *     radians     - returns a pointer to radians converted from degrees
- */
-float64
-radians(float64 arg1)
-{
-   float64     result;
-
-   if (!arg1)
-       return (float64) NULL;
-
-   result = (float64) palloc(sizeof(float64data));
-
-   *result = ((*arg1) * (M_PI / 180.0));
-
-   CheckFloat8Val(*result);
-   return result;
-} /* radians() */
-
-
-#ifdef RAND_MAX
-
-/*
- *     drandom     - returns a random number
- */
-float64
-drandom(void)
-{
-   float64     result;
-
-   result = (float64) palloc(sizeof(float64data));
-
-   /* result 0.0-1.0 */
-   *result = (((double)rand()) / RAND_MAX);
-
-   CheckFloat8Val(*result);
-   return result;
-} /* drandom() */
-
-
-/*
- *     setseed     - set seed for the random number generator
- */
-void
-setseed(int32 seed)
-{
-   srand(seed);
-
-   return;
-} /* setseed() */
-
-#endif
-
-
index fabf9bee39764973393b8d64db26a391aaa74910..8b3049c6ee71edfeaac84cbd7e451e228962bfa2 100644 (file)
@@ -1,5 +1,5 @@
 
 
  
@@ -31,9 +31,9 @@ $Header: /cvsroot/pgsql/doc/src/sgml/ecpg.sgml,v 1.15 2000/08/23 05:59:01 thomas
   
    This describes an embedded SQL in C 
    package for Postgres.
-
    It is written by Linus Tolke
    and Michael Meskes.
+   The package is installed with the Postgres distribution.
 
    
     
@@ -503,17 +503,6 @@ struct sqlca
    
   
 
-  
-   Installation
-
-   
-    Since version 0.5 ecpg is distributed 
-    together with Postgres. So you
-    should get your precompiler, libraries and header files compiled and
-    installed by default as a part of your installation.
-   
-  
-
   
    For the Developer
 
index 04b8def4ed1634a12cd751f27d6d6316e643628f..10fc2d90e8fdf4cef72fff9e75176001ce202540 100644 (file)
@@ -1,5 +1,5 @@
 
 
@@ -233,7 +233,7 @@ P''(t)  generation of descendants at a time t
 
   
    Future Implementation Tasks for</div> <div class="diff rem">-    <productname><span class="marked">ame>Post</productname>ame</span>> <acronym>GEQO</acronym>
+    PostgreSQLGEQO
 
    
     Basic Improvements
index a50f1f8bb59a71e95deadf8df48dcc143d256e88..b4d1826550a05c80200c881b6d7c72be3e6d91a5 100644 (file)
@@ -1,5 +1,5 @@
 
 
  
@@ -70,496 +70,69 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/odbc.sgml,v 1.16 2000/08/29 20:02:07
     same calls and the back end data source would look the same (to the Windows
     app).
    
-
-
   
 
   
-   <span class="marked"><productname>Windows</productname> Applications</span>
+   <span class="marked">Installation</span>
 
    
-    In the real world, differences in drivers and the level of 
-    ODBC support
-    lessens the potential of ODBC:
-
-    
-     
-      
-       Access, Delphi, and Visual Basic all support ODBC directly.
-      
-     
-     
-      
-       Under C++, such as Visual C++, 
-       you can use the C++ ODBC API.
-      
-     
-
-     
-      
-       In Visual C++, you can use the CRecordSet class, which wraps the 
-       ODBC API
-       set within an MFC 4.2 class.  This is the easiest route if you are doing
-       Windows C++ development under Windows NT.
-      
-     
-    
+    The first thing to note about the psqlODBC driver
+    (or any ODBC driver) is that there must exist a
+    driver manager on the system where the
+    ODBC driver is to be used. There exists a free
+    ODBC driver for Unix called iODBC
+    which can be obtained via 
+    url="http://www.iodbc.org">http://www.iodbc.org.
+    Instructions for installing iODBC are contained in
+    the iODBC distribution. Having said that, any
+    driver manager that you can find for your platform should support
+    the psqlODBC driver, or any other ODBC
+    driver for that matter.
    
 
-   
-    Writing Applications
-
-    
-     
-      If I write an application for Postgres 
-      can I write it using ODBC calls
-      to the Postgres server, 
-      or is that only when another database program 
-      like MS SQL Server or Access needs to access the data?
-     
-    
-    
-     The ODBC API
-     is the way to go.
-     For Visual C++ coding you can find out more at
-     Microsoft's web site or in your VC++ docs.
-    
-
-    
-     Visual Basic and the other RAD tools have Recordset objects 
-     that use ODBC
-     directly to access data.  Using the data-aware controls, you can quickly
-     link to the ODBC back end database 
-     (very quickly).
-    
-
-    
-     Playing around with MS Access will help you sort this out.  Try using
-     File->Get External Data.
-    
-
-    
-     
-      You'll have to set up a DSN first.
-     
-    
-
-    
-   
-  
+   
+    To install psqlODBC you simply need to supply the
+    
+    building the entire PostgreSQL distribution. The library
+    and header files will then automatically be built and installed with the
+    rest of the programs. If you forget that option or want to build the ODBC
+    driver later you can change into the directory src/interfaces/odbc
+    and do make and make install there.
+   
 
-  
-   Unix Installation
+   
+    The installation-wide configuration file odbcinst.ini will be
+    installed into the directory /usr/local/pgsql/etc/, or equivalent,
+    depending on what 
+    you supplied to configure. Since this file can also be shared
+    between different ODBC drivers you can also install it in a shared
+    location. To do that, override the location of this file with the
+    
+   
 
    
-    ApplixWare has an 
-    ODBC database interface
-    supported on at least some platforms. 
-    ApplixWare v4.4.2 has been
-    demonstrated under Linux with Postgres v7.0 
-    using the psqlODBC
-    driver contained in the Postgres distribution.
+    Additionally, you should install the ODBC catalog extensions.  That will
+    provide a number of functions mandated by the ODBC standard that are not
+    supplied by PostgreSQL by default. The file
+    /usr/local/pgsql/share/odbc.sql (in the default installation layout)
+    contains the appropriate definitions, which you can install as follows:
+
+psql -d template1 -f LOCATION/odbc.sql
+
+    where specifying template1 as the target
+    database will ensure that all subsequent new databases will
+    have these same definitions.
    
 
    
-    Building the Driver
-
-    
-     The first thing
-     to note about the psqlODBC driver
-     (or any ODBC driver) is that there must
-     exist a driver manager on the system where
-     the ODBC driver is to be
-     used. There exists a freeware ODBC driver for Unix
-     called iodbc which
-     can be obtained from various locations on the Net, including at
-     AS200. 
-     Instructions for installing iodbc
-     are beyond the scope of this
-     document, but there is a README
-     that can be found inside the iodbc compressed
-     .shar file that should explain how to get it up and running.
-    
-
-    
-     Having said that, any driver manager that you can find for your platform
-     should support the psqlODBC driver
-     or any ODBC driver.
-    
-
-    
-     The Unix configuration files for psqlODBC
-     have recently been extensively
-     reworked to allow for easy building on supported platforms as
-     well as to allow for support of other Unix platforms in the future.
-     The new configuration and build files for the driver should make it
-     a simple process to build the driver on the supported platforms. Currently
-     these include Linux and FreeBSD but we are hoping other users will
-     contribute the necessary information to quickly expand the number of
-     platforms for which the driver can be built.
-    
-
-    
-     There are actually two separate methods to build the driver depending on
-     how you received it and these differences come down to only where and how to
-     run configure and make
-     The driver can be built in a standalone, client-only installation, or can be 
-     built as a part of the main Postgres distribution.
-     The standalone installation is convenient if you have ODBC
-     client applications on multiple, heterogeneous platforms. The integrated
-     installation is convenient when the target client is the same as the
-     server, or when the client and server have similar runtime configurations.
-    
-
-    
-     Specifically if you have received the psqlODBC
-     driver as part of the Postgres distribution
-     (from now on referred to as an "integrated" build) then you will
-     configure and make the ODBC driver
-     from the top level source directory
-     of the Postgres distribution
-     along with the rest of its libraries.
-     If you received the driver as a standalone package than you will run
-     configure and make from the directory in which you unpacked the
-     driver source.
-    
-
-    
-     Integrated Installation
-
-     
-      This installation procedure is appropriate for an integrated installation.
-     
-
-     
-      
-       Specify the 
-       command-line argument for src/configure:
-
-       
-% ./configure --with-odbc
-% make
-       
-      
-     
-
-     
-      
-       Rebuild the Postgres distribution:
-
-       
-% make install
-       
-      
-     
-
-     
-      
-       Install the ODBC catalog extensions available in
-       PGROOT/contrib/odbc/odbc.sql:
-
-       
-% psql -e template1 < $PGROOT/contrib/odbc/odbc.sql
-       
-
-       where specifying template1 as the target
-       database will ensure that all subsequent new databases will
-       have these same definitions.
-      
-     
-    
-
+    Supported Platforms
     
-     Once configured, the ODBC driver will be built and installed
-     into the areas defined for the other components of the
-     Postgres system. The installation-wide
-     ODBC configuration file will be placed into
-     the top directory of the Postgres target tree (POSTGRESDIR).
-     This can be overridden from the make command-line
-     as
-     
-% make ODBCINST=filename install
-     
+     psqlODBC has been built and tested
+     on Linux. There have been reports of success
+     with FreeBSD and with Solaris. There are no known restrictions
+     on the basic code for other platforms which already support
+     Postgres.
     
-
-    
-     Pre-v6.4 Integrated Installation
-
-     
-      If you have a Postgres installation older than
-      v6.4, you have the original source tree available, 
-      and you want to use the newest version of the ODBC
-      driver, then you may want to try this form of installation.
-     
-
-     
-      
-       Copy the output tar file to your target system and unpack it into a 
-       clean directory.
-      
-     
-     
-      
-       From the directory containing the
-       sources, type:
-
-       
-% ./configure
-% make
-% make POSTGRESDIR=PostgresTopDir install
-       
-      
-     
-
-     
-      
-       If you would like to install components into different trees, 
-       then you can specify various destinations explicitly:
-
-       
-% make BINDIR=bindir  LIBDIR=libdir  HEADERDIR=headerdir ODBCINST=instfile install
-       
-      
-     
-    
-
-    
-     Standalone Installation
-
-     
-      A standalone installation is not integrated with or built on the normal
-      Postgres distribution. It should be best suited
-      for building the ODBC driver for multiple, heterogeneous
-      clients who do not have a locally-installed Postgres
-      source tree.
-     
-
-     
-      The default location for libraries and headers 
-      for the standalone installation is /usr/local/lib
-      and /usr/local/include/iodbc, respectively.
-      There is another system wide configuration file that gets installed
-      as /share/odbcinst.ini (if /share
-      exists) or as /etc/odbcinst.ini
-      (if /share does not exist).
-     
-
-     
-      
-       Installation of files into /share
-       or /etc requires system root privileges.
-       Most installation steps for Postgres do not
-       have this requirement, and you can choose another destination which
-       is writable by your non-root Postgres superuser
-       account instead.
-      
-     
-
-     
-      
-       The standalone installation distribution can be built from the
-       Postgres distribution or may be obtained from 
-       Insight Distributors,
-       the current maintainers of the non-Unix sources.
-      
-
-      
-       Copy the zip
-       or gzipped tarfile to an empty directory. If using the zip package
-       unzip it with the command 
-       
-% unzip -a packagename
-       
-
-       The  option
-       is necessary to get rid of DOS 
-       CR/LF pairs in the source files.
-      
-
-      
-       If you have the gzipped tar package than simply run
-
-       
-% tar -xzf packagename
-       
-      
-
-      
-
-       
-   
-    To create a tar file for a complete standalone installation
-    from the main Postgres source tree:
-   
-       
-      
-     
-     
-      
-       Configure the main Postgres distribution.
-      
-     
-     
-      
-       Create the tar file:
-
-       
-% cd interfaces/odbc
-% make standalone
-       
-      
-     
-
-     
-      
-       Copy the output tar file to your target system. Be sure to transfer as
-       a binary file if using ftp.
-      
-     
-
-     
-      
-       Unpack the tar file into a clean
-       directory.
-      
-     
-
-     
-      
-       Configure the standalone installation:
-
-       
-% ./configure
-       
-      
-
-      
-       The configuration can be done with options:
-
-       
-% ./configure --prefix=rootdir --with-odbc=inidir
-       
-
-       where  installs the libraries and headers in
-       the directories rootdir/lib and
-       rootdir/include/iodbc, and
-        installs odbcinst.ini in the
-       specified directory.
-      
-
-      
-       Note that both of these options can also be used from the integrated build
-       but be aware that when used in the integrated build
-        will also apply to the rest of
-       your Postgres installation.
-        applies only to the configuration file
-       odbcinst.ini.
-      
-     
-
-     
-      
-       Compile and link the source code:
-
-       
-% make ODBCINST=instdir
-       
-      
-
-      
-       You can also override the default location for installation on the
-       'make' command line. This only applies to the installation of the
-       library and header files. Since the driver needs to know the location
-       of the odbcinst.ini file attempting to override the enviroment variable
-       that specifies its installation directory will probably cause you
-       headaches. It is safest simply to allow the driver to install the
-       odbcinst.ini file in the default directory or the directory you specified
-       on the './configure' command line with --with-odbc.
-      
-     
-
-     
-
-     
-      
-       Install the source code:
-
-       
-% make POSTGRESDIR=targettree install
-       
-      
-
-      
-       To override the library and header installation directories separately
-       you need to pass the correct installation variables on the
-       make install command line. These variables are
-       LIBDIRHEADERDIR
-       and ODBCINST.
-       Overriding POSTGRESDIR on the make command line will cause
-       LIBDIR and HEADERDIR
-       to be rooted at the new directory you specify. 
-       ODBCINST is independent of POSTGRESDIR.
-      
-
-      
-       Here is how you would specify the various destinations explicitly:
-
-       
-% make BINDIR=bindir LIBDIR=libdir HEADERDIR=headerdir install
-       
-      
-
-      
-       For example, typing
-
-       
-% make POSTGRESDIR=/opt/psqlodbc install
-       
-
-       (after you've used
-       ./configure and make)
-       will cause the libraries and headers to be installed in the directories
-       /opt/psqlodbc/lib
-       and /opt/psqlodbc/include/iodbc respectively.
-      
-
-      
-       The command
-
-       
-% make POSTGRESDIR=/opt/psqlodbc HEADERDIR=/usr/local install
-       
-
-       should cause the libraries to be installed in /opt/psqlodbc/lib and
-       the headers in /usr/local/include/iodbc. If this doesn't work as
-       expected please contact one of the maintainers.
-      
-     
-    
    
   
 
@@ -584,7 +157,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/odbc.sgml,v 1.16 2000/08/29 20:02:07
     [ODBC Data Sources] and must contain the following entries: 
 
     
-Driver = POSTGRESDIR/lib/libpsqlodbc.so
+Driver = prefix/lib/libpsqlodbc.so
 Database=DatabaseName
 Servername=localhost
 Port=5432
@@ -647,9 +220,101 @@ InstallDir = /opt/applix/axdata/axshlib
    
   
 
+  
+   <productname>Windows</productname> Applications
+
+   
+    In the real world, differences in drivers and the level of 
+    ODBC support
+    lessens the potential of ODBC:
+
+    
+     
+      
+       Access, Delphi, and Visual Basic all support ODBC directly.
+      
+     
+     
+      
+       Under C++, such as Visual C++, 
+       you can use the C++ ODBC API.
+      
+     
+
+     
+      
+       In Visual C++, you can use the CRecordSet class, which wraps the 
+       ODBC API
+       set within an MFC 4.2 class.  This is the easiest route if you are doing
+       Windows C++ development under Windows NT.
+      
+     
+    
+   
+
+   
+    Writing Applications
+
+    
+     
+      If I write an application for Postgres 
+      can I write it using ODBC calls
+      to the Postgres server, 
+      or is that only when another database program 
+      like MS SQL Server or Access needs to access the data?
+     
+    
+    
+     The ODBC API
+     is the way to go.
+     For Visual C++ coding you can find out more at
+     Microsoft's web site or in your VC++ docs.
+    
+
+    
+     Visual Basic and the other RAD tools have Recordset objects 
+     that use ODBC
+     directly to access data.  Using the data-aware controls, you can quickly
+     link to the ODBC back end database 
+     (very quickly).
+    
+
+    
+     Playing around with MS Access will help you sort this out.  Try using
+     File->Get External Data.
+    
+
+    
+     
+      You'll have to set up a DSN first.
+     
+    
+
+    
+   
+  
+
+
   
    ApplixWare
 
+   
+    ApplixWare has an 
+    ODBC database interface
+    supported on at least some platforms. 
+    ApplixWare 4.4.2 has been
+    demonstrated under Linux with Postgres 7.0 
+    using the psqlODBC
+    driver contained in the Postgres distribution.
+   
+
    
     Configuration
 
@@ -1089,17 +754,7 @@ endmacro
      
     
    
-   
-    Supported Platforms
 
-    
-     psqlODBC has been built and tested
-     on Linux. There have been reports of success
-     with FreeBSD and with Solaris. There are no known restrictions
-     on the basic code for other platforms which already support
-     Postgres.
-    
-   
   
  
 
index 0e93f3e4c71b8288e6fbaf456e1d811c2e2c9b93..8817c3c290e9dafc1c87fbec8bd6b0d2a1bbb7b8 100644 (file)
@@ -21,9 +21,6 @@ is assumed to contain 8 bits.  In addition, the term
 refers to data which is stored in Postgres classes.
 
 
-
-Page Structure
-
 
 The following table shows how pages in both normal Postgres classes
  and Postgres index
@@ -176,50 +173,5 @@ itemPointerData
 which points to the next piece and the piece itself.  The last piece
 is handled normally.
 
-
-
-
-Files
-
-
-
-
-
-data/
-
-
-
-Location of shared (global) database files.
-
-
-
-
-
-
-data/base/
-
-
-
-Location of local database files.
-
-
-
 
-
-
-
-
-
-Bugs
-
-
-The page format may change in the future to provide more efficient
-access to large objects.
-
-
-
-This section contains insufficient detail to be of any assistance in
-writing a new access method.
-
-
 
index 81c16387ca9c1cf59cb8a02e96aa79e1f4e7ff24..a51f71899ac013b299229e727637b9929b488139 100644 (file)
@@ -2,7 +2,7 @@
 #
 # GNUMakefile for psqlodbc (Postgres ODBC driver)
 #
-# $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/GNUmakefile,v 1.3 2000/09/17 13:02:51 petere Exp $
+# $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/GNUmakefile,v 1.4 2000/09/18 20:11:37 petere Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -35,21 +35,27 @@ LDFLAGS_SL+= $(LDFLAGS_ODBC)
 odbc_headers = isql.h isqlext.h iodbc.h
 odbc_includedir = $(includedir)/iodbc
 
-install: all installdirs install-headers install-ini install-lib
+install: all installdirs install-headers install-ini install-lib install-data
 
 installdirs:
-   $(mkinstalldirs) $(DESTDIR)$(odbc_includedir) $(DESTDIR)$(libdir) $(DESTDIR)$(odbcinst_ini_dir)
+   $(mkinstalldirs) $(DESTDIR)$(odbc_includedir) $(DESTDIR)$(libdir) $(DESTDIR)$(odbcinst_ini_dir) $(DESTDIR)$(datadir)
 
 .PHONY: install-headers
 install-headers: $(odbc_headers)
-   for i in $^; do $(INSTALL_DATA) $$i $(DESTDIR)$(odbc_includedir) || exit 1; done
+   for i in $^; do $(INSTALL_DATA) $$i $(DESTDIR)$(odbc_includedir)/$$i || exit 1; done
 
 .PHONY: install-ini
 install-ini: odbcinst.ini
-   $(INSTALL_DATA) $< $(DESTDIR)$(odbcinst_ini_dir)
+   $(INSTALL_DATA) $< $(DESTDIR)$(odbcinst_ini_dir)/$<
+
+.PHONY: install-data
+install-data: odbc.sql
+   $(INSTALL_DATA) $< $(DESTDIR)$(datadir)/$<
 
 uninstall: uninstall-lib
    rm -f $(addprefix $(DESTDIR)$(odbc_includedir)/, $(odbc_headers))
+   rm -f $(DESTDIR)$(datadir)/odbc.sql
+# XXX Uninstall the .ini file as well?
 
 clean distclean maintainer-clean: clean-lib
    rm -f $(OBJS)
similarity index 95%
rename from contrib/odbc/odbc.sql
rename to src/interfaces/odbc/odbc.sql
index bec7f486b4fe4ee43e4cca2b1572aa2c8827c7c6..f4e593d329ac8a6b2c791221b42d2d6c890fb05b 100644 (file)
@@ -1,16 +1,11 @@
--- ODBC.sql
---
+-- PostgreSQL catalog extensions for ODBC compliance
+-- $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/odbc.sql,v 1.1 2000/09/18 20:11:37 petere Exp $
 
---
--- Character string manipulation
---
 
---
--- Extensions for ODBC compliance in v7.0.
 -- In the current driver, ODBC functions must map directly into a
 -- Postgres function. So in some cases we must create a compatible
 -- function.
---
+
 
 -- truncate on the left
 CREATE FUNCTION ltrunc(text, integer)
@@ -142,4 +137,3 @@ CREATE FUNCTION odbc_user()
     RETURNS text
     AS 'SELECT CAST(USER AS text)'
     LANGUAGE 'SQL';
-