head	1.9;
access;
symbols
	REL6_5_PATCHES:1.8.0.4
	REL6_5:1.8
	REL6_4:1.8.0.2
	release-6-3:1.5
	SUPPORT:1.1.1.1
	PG95-DIST:1.1.1;
locks; strict;
comment	@# @;


1.9
date	99.10.11.17.46.56;	author momjian;	state dead;
branches;
next	1.8;

1.8
date	98.09.11.05.18.12;	author momjian;	state Exp;
branches;
next	1.7;

1.7
date	98.09.11.05.14.06;	author momjian;	state Exp;
branches;
next	1.6;

1.6
date	98.08.11.02.31.56;	author momjian;	state Exp;
branches;
next	1.5;

1.5
date	97.09.16.15.36.06;	author momjian;	state Exp;
branches;
next	1.4;

1.4
date	96.09.26.14.07.05;	author momjian;	state Exp;
branches;
next	1.3;

1.3
date	96.09.19.20.18.56;	author scrappy;	state Exp;
branches;
next	1.2;

1.2
date	96.09.19.20.16.49;	author scrappy;	state dead;
branches;
next	1.1;

1.1
date	96.08.18.22.14.31;	author scrappy;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	96.08.18.22.14.31;	author scrappy;	state Exp;
branches;
next	;


desc
@@


1.9
log
@Add pginterface into main tree, called pgeasy.
@
text
@

   			      Pginterface 2.0

Attached is a copy of the Postgres support routines I wrote to allow me
to more cleanly interface to the libpg library, more like a 4gl SQL
interface.

You can create a library of pginterface.c and halt.c, and just include
pginterface.h in your source code.

I am willing to maintain this if people find problems or want additional
functionality. 

Bruce Momjian (root@@candle.pha.pa.us)
@


1.8
log
@update pginterface
@
text
@@


1.7
log
@Update pginterface for 6.4. add manual page.
@
text
@a8 24
It has several features that may be useful for others:

I have simplified the C code that calls libpq by wrapping all the
functionality of libpq in calls to connectdb(), doquery(), fetch(),
fetchwithnulls() and disconnectdb().  Each call returns a structure or
value, so if you need to do more work with the result, you can.  Also, I
have a global variable that allows you to disable the error checking I
have added to the doquery() routine.

I have added a function called fetch(), which allows you to pass
pointers as parameters, and on return the variables are filled with data
from the binary cursor you opened.  These binary cursors are not useful
if you are running the query engine on a system with a different
architecture than the database server.  If you pass a NULL pointer, the
column is skipped, and you can use libpq to handle it as you wish.

There are two functions, get_result() and set_result(), that allow you
to handle multiple result sets at the same time.

There is a reset_fetch() that starts the fetch back at the beginning.

There is a demo program called pginsert that demonstrates how the
library can be used.

@


1.6
log
@New findoidjoins examines oid columns to find join relationships.
@
text
@d19 3
a21 3
pointers as parameters, and on return the variables are filled with the
data from the binary cursor you opened.  These binary cursors are not
useful if you are running the query engine on a system with a different
d25 2
a26 2
There are two functions, get_result() and set_result, that allow you to
handle multiple result sets at the same time.
@


1.5
log
@Removed un-needed signal suff from pginterface.
@
text
@d25 5
@


1.4
log
@Updated version.
@
text
@a24 8
I have used sigprocmask() to block the reception of certain signals
while the program is executing SQL queries.  This prevents a user
pressing Control-C from stopping all the back ends.  It blocks SIGHUP,
SIGINT, and SIGTERM, but does not block SIGQUIT or obviously kill -9. 
If your platform does not support sigprocmask(), you can remove those
function calls.  ( Am I correct that abnormal termination can cause
shared memory resynchronization?)

@


1.3
log
@Newer version of Bruce's pginterface library...
@
text
@d3 1
a3 1
   			      Pginterface 1.0
d13 1
a13 1
fetchisnull() and disconnectdb().  Each call returns a structure or
@


1.2
log
@Clean out the old...
@
text
@d12 5
a16 5
functionality of libpq in calls to connectdb(), doquery(), fetch(), and
disconnectdb().  Each call returns a structure or value, so if you need
to do more work with the result, you can.  Also, I have a global
variable that allows you to disable the error checking I have added to
the doquery() routine.
@


1.1
log
@Initial revision
@
text
@@


1.1.1.1
log
@Support Docs & Contrib
@
text
@@
