Commit 5e55bb08 authored by Thomas G. Lockhart's avatar Thomas G. Lockhart

Add Bruce's pgeasy doc from the man page.

parent f38d2afa
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/libpgeasy.sgml,v 2.1 2000/03/31 03:26:21 thomas Exp $
-->
<chapter id="pgeasy-chapter">
<title id="pgeasy">libpgeasy - Simplified C Binding Library</title>
<note>
<title>Author</title>
<para>
Written by Bruce Momjian
(<ulink url="mailto:root@candle.pha.pa.us">root@candle.pha.pa.us</ulink>)
and last updated 2000-03-30.
</para>
</note>
<para>
<productname>pgeasy</productname> allows you to cleanly interface
to the <productname>libpq</productname> library,
more like a 4GL SQL interface.
</para>
<para>
It consists of set of simplified C functions that encapsulate the
functionality of libpq.
The functions are:
<itemizedlist>
<listitem>
<para>
PGresult *doquery(char *query);
</para>
</listitem>
<listitem>
<para>
PGconn *connectdb();
</para>
</listitem>
<listitem>
<para>
void disconnectdb();
</para>
</listitem>
<listitem>
<para>
int fetch(void *param,...);
</para>
</listitem>
<listitem>
<para>
int fetchwithnulls(void *param,...);
</para>
</listitem>
<listitem>
<para>
void reset_fetch();
</para>
</listitem>
<listitem>
<para>
void on_error_continue();
</para>
</listitem>
<listitem>
<para>
void on_error_stop();
</para>
</listitem>
<listitem>
<para>
PGresult *get_result();
</para>
</listitem>
<listitem>
<para>
void set_result(PGresult *newres);
</para>
</listitem>
<listitem>
<para>
void unset_result(PGresult *oldres);
</para>
</listitem>
</itemizedlist>
</para>
<para>
Many functions return a structure or value, so you can do more work
with the result if required.
</para>
<para>
You basically connect to the database with <function>connectdb</function>,
issue your query with <function>doquery</function>,
fetch the results with <function>fetch</function>,
and finish with <function>disconnectdb</function>.
</para>
<para>
For <literal>select</literal> queries, <function>fetch</function>
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 can not be used if you are running the
<productname>pgeasy</productname>
client on a system with a different architecture than the database
server. If you pass a NULL pointer parameter, the column is skipped.
<function>fetchwithnulls</function> allows you to retrieve the NULL
status of the field by passing an <literal>int*</literal>
after each result pointer, which returns true or false if the field is null.
You can always use libpq functions on the PGresult pointer returned
by <function>doquery</function>.
<function>reset_fetch</function> starts the fetch back at the beginning.
</para>
<para>
<function>get_result</function>,
<function>set_result</function>,
and
<function>unset_result</function>
allow you to handle multiple result sets at the same time.
</para>
<para>
There are a variety of demonstration programs in the
source directory.
</para>
</chapter>
<!-- Keep this comment at the end of the file
Local variables:
mode:sgml
sgml-omittag:nil
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"./reference.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:("/usr/lib/sgml/catalog")
sgml-local-ecat-files:nil
End:
-->
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/postgres.sgml,v 1.35 2000/03/31 03:26:21 thomas Exp $
-->
<!doctype book PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [
<!entity about SYSTEM "about.sgml">
......@@ -68,6 +72,7 @@
<!entity intro-pg SYSTEM "intro-pg.sgml">
<!entity indexcost SYSTEM "indexcost.sgml">
<!entity jdbc SYSTEM "jdbc.sgml">
<!entity libpgeasy SYSTEM "libpgeasy.sgml">
<!entity libpq SYSTEM "libpq.sgml">
<!entity libpqpp SYSTEM "libpq++.sgml">
<!entity libpgtcl SYSTEM "libpgtcl.sgml">
......@@ -269,6 +274,7 @@ Your name here...
&libpq;
&libpqpp;
&libpgtcl;
&libpgeasy;
&odbc;
&jdbc;
&lisp;
......@@ -345,7 +351,7 @@ sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"./reference.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:("/usr/lib/sgml/CATALOG")
sgml-local-catalogs:("/usr/lib/sgml/catalog")
sgml-local-ecat-files:nil
End:
-->
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/programmer.sgml,v 1.24 2000/03/30 22:34:29 thomas Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/programmer.sgml,v 1.25 2000/03/31 03:26:21 thomas Exp $
Postgres Programmer's Guide.
$Log: programmer.sgml,v $
Revision 1.24 2000/03/30 22:34:29 thomas
Remove PL/perl language chapter, since it shows up in the User's Guide.
Revision 1.23 2000/03/30 22:22:41 thomas
Accumulated fixups.
Add some chapters on new topics.
Change to referencing OASIS/Docbook v3.1 rather than Davenport/Docbook v3.0
Grepped for and fixed apparent tag mangling from emacs
"Normalize" operation. Should be the last of those.
Revision 1.22 2000/03/28 14:16:06 thomas
Update SGML catalog references to DocBook 3.1 on FreeBSD.
Matches postgresql.org/hub.org environment.
Revision 1.21 2000/02/02 16:25:04 thomas
Add short chapter in developer's guide on formatting source code.
Revision 1.20 1999/12/06 16:37:11 thomas
Remove references to PostgreSQL as "public-domain" since that has a
specific meaning wrt copyright (or lack thereof).
Revision 1.19 1999/07/22 15:11:04 thomas
Complete merge of all old man page information.
lisp.sgml is a placeholder for Eric Marsden's upcoming contribution.
catalogs.sgml is not yet marked up or integrated.
It should perhaps become an appendix.
Revision 1.18 1999/06/23 06:21:19 thomas
Remove User's Guide entities since they were not being used.
Revision 1.16 1999/05/26 17:30:30 thomas
Add chapters on CVS access, MVCC, SQL theory to the docs.
Add an appendix with more details on date/time attributes and handling.
Update most references to Postgres version numbers to 6.5,
*except* for the porting list which will require a report
from a successful installation to be updated.
Revision 1.12 1999/02/13 03:54:51 thomas
Re-enable arch-dev.sgml now that it has new information from Stefan's
Master's Thesis.
Revision 1.10 1998/10/31 09:36:36 thomas
Cleanup for v6.4 release.
Make new file current.sgml to hold release info for the current release.
Should be moved to release.sgml before filling with next release info.
-->
<!doctype book PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [
<!entity about SYSTEM "about.sgml">
<!entity history SYSTEM "history.sgml">
<!entity info SYSTEM "info.sgml">
<!entity legal SYSTEM "legal.sgml">
<!entity notation SYSTEM "notation.sgml">
<!entity problems SYSTEM "problems.sgml">
<!entity y2k SYSTEM "y2k.sgml">
<!entity about SYSTEM "about.sgml">
<!entity history SYSTEM "history.sgml">
<!entity info SYSTEM "info.sgml">
<!entity legal SYSTEM "legal.sgml">
<!entity notation SYSTEM "notation.sgml">
<!entity problems SYSTEM "problems.sgml">
<!entity y2k SYSTEM "y2k.sgml">
<!entity arch-pg SYSTEM "arch-pg.sgml">
<!entity dfunc SYSTEM "dfunc.sgml">
......@@ -71,6 +23,7 @@ Make new file current.sgml to hold release info for the current release.
<!entity intro-pg SYSTEM "intro-pg.sgml">
<!entity indexcost SYSTEM "indexcost.sgml">
<!entity jdbc SYSTEM "jdbc.sgml">
<!entity libpgeasy SYSTEM "libpgeasy.sgml">
<!entity libpq SYSTEM "libpq.sgml">
<!entity libpqpp SYSTEM "libpq++.sgml">
<!entity libpgtcl SYSTEM "libpgtcl.sgml">
......@@ -201,6 +154,7 @@ Disable it until we put in some info.
&libpq;
&libpqpp;
&libpgtcl;
&libpgeasy;
&ecpg;
&odbc;
&jdbc;
......@@ -246,7 +200,7 @@ sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"./reference.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:("/usr/lib/sgml/CATALOG")
sgml-local-catalogs:("/usr/lib/sgml/catalog")
sgml-local-ecat-files:nil
End:
-->
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