head	2.10;
access;
symbols
	REL7_2_8:2.8
	REL7_2_7:2.8
	REL7_2_6:2.8
	REL7_2_5:2.8
	REL7_2_4:2.8
	REL7_2_3:2.8
	REL7_3_STABLE:2.9.0.2
	REL7_2_STABLE:2.8.0.2
	REL7_2:2.8
	REL7_2_RC2:2.8
	REL7_2_RC1:2.8
	REL7_2_BETA5:2.8
	REL7_2_BETA4:2.7
	REL7_2_BETA3:2.7
	REL7_2_BETA2:2.7
	REL7_2_BETA1:2.7
	REL7_1_2:2.5
	REL7_1_STABLE:2.5.0.2
	REL7_1_BETA:2.3
	REL7_1_BETA3:2.4
	REL7_1_BETA2:2.4
	REL7_1:2.4
	REL7_0_PATCHES:2.3.0.2
	REL7_0:2.2;
locks; strict;
comment	@# @;


2.10
date	2002.10.21.23.14.10;	author momjian;	state dead;
branches;
next	2.9;

2.9
date	2002.03.04.18.50.20;	author momjian;	state Exp;
branches
	2.9.2.1;
next	2.8;

2.8
date	2002.01.07.02.29.12;	author petere;	state Exp;
branches;
next	2.7;

2.7
date	2001.10.01.21.47.24;	author momjian;	state Exp;
branches;
next	2.6;

2.6
date	2001.09.10.21.58.46;	author petere;	state Exp;
branches;
next	2.5;

2.5
date	2001.04.20.15.52.33;	author thomas;	state Exp;
branches;
next	2.4;

2.4
date	2000.12.22.21.51.58;	author petere;	state Exp;
branches;
next	2.3;

2.3
date	2000.05.18.14.24.31;	author momjian;	state Exp;
branches;
next	2.2;

2.2
date	2000.04.27.18.45.43;	author momjian;	state Exp;
branches;
next	2.1;

2.1
date	2000.03.31.03.26.21;	author thomas;	state Exp;
branches;
next	;

2.9.2.1
date	2002.11.04.21.24.29;	author tgl;	state dead;
branches;
next	;


desc
@@


2.10
log
@Move libpgeasy.sgml to gborg.
@
text
@<!--
$Header: /cvsroot/pgsql-server/doc/src/sgml/libpgeasy.sgml,v 2.9 2002/03/04 18:50:20 momjian Exp $
-->

 <chapter id="pgeasy">
  <title><application>libpgeasy</application> - Simplified C Library</title>

  <note>
   <title>Author</title>

   <para>
    Written by Bruce Momjian
    (<email>pgman@@candle.pha.pa.us</email>)
    and last updated 2002-03-04
   </para>
  </note>

  <para>
   <application>pgeasy</application> allows you to cleanly interface
   to the <application>libpq</application> library, more like a 4GL
   SQL interface.  Refer to <xref linkend="libpq"> for more
   information about <application>libpq</application>.
  </para>

  <para>
   It consists of a set of simplified C functions that encapsulate the
   functionality of <application>libpq</application>. The functions are:

   <itemizedlist>
    <listitem>
<synopsis>
PGresult   *doquery(char *query);
</synopsis>
    </listitem>

    <listitem>
<synopsis>
PGconn     *connectdb(char *options);
</synopsis>
    </listitem>

    <listitem>
<synopsis>
void        disconnectdb();
</synopsis>
    </listitem>

    <listitem>
<synopsis>
int         fetch(void *param,...);
</synopsis>
    </listitem>

    <listitem>
<synopsis>
int         fetchwithnulls(void *param,...);
</synopsis>
    </listitem>

    <listitem>
<synopsis>
void        reset_fetch();
</synopsis>
    </listitem>

    <listitem>
<synopsis>
void        on_error_continue();
</synopsis>
    </listitem>

    <listitem>
<synopsis>
void        on_error_stop();
</synopsis>
    </listitem>

    <listitem>
<synopsis>
PGresult   *get_result();
</synopsis>
    </listitem>

    <listitem>
<synopsis>
void        set_result(PGresult *newres);
</synopsis>
    </listitem>

   </itemizedlist>
  </para>

  <para>
   Many functions return a structure or value, so you can 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 cannot be used if you are running the
   <application>pgeasy</application> 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 to indicate if the field is null. You can always use
   <application>libpq</application> functions on the
   <structname>PGresult</structname> pointer returned by
   <function>doquery</function>. <function>reset_fetch</function> starts
   the fetch back at the beginning.
  </para>

  <para>
   <function>get_result</function> and <function>set_result</function>
   allow you to handle multiple open result sets. Use
   <function>get_result</function> to save a result into an application
   variable. You can then later use <function>set_result</function> to
   return to the previously save result.
  </para>

  <para>
   There are several demonstration programs in
   <filename>pgsql/src/interfaces/libpgeasy/examples</>.
  </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:
-->
@


2.9
log
@Improve libpgeasy API for multiple result sets, add example.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql/doc/src/sgml/libpgeasy.sgml,v 2.8 2002/01/07 02:29:12 petere Exp $
@


2.9.2.1
log
@Back-patch recent file removals into REL7_3_STABLE branch.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/Attic/libpgeasy.sgml,v 2.9 2002/03/04 18:50:20 momjian Exp $
@


2.8
log
@Editorial review
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql/doc/src/sgml/libpgeasy.sgml,v 2.7 2001/10/01 21:47:24 momjian Exp $
d14 1
a14 1
    and last updated 2000-03-30
d22 1
a22 1
   information about <application>libpq</application>
d26 2
a27 3
   It consists of set of simplified C functions that encapsulate the
   functionality of <application>libpq</application>.
   The functions are:
a89 5
    <listitem>
<synopsis>
void        unset_result(PGresult *oldres);
</synopsis>
    </listitem>
d94 1
a94 1
   Many functions return a structure or value, so you can do more work
d99 5
a103 4
   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>.
d108 13
a120 12
   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 cannot be used if you are running the
   <application>pgeasy</application>
   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 <application>libpq</application> functions on the <structname>PGresult</structname> pointer returned
   by <function>doquery</function>.
   <function>reset_fetch</function> starts the fetch back at the beginning.
d124 5
a128 5
   <function>get_result</function>,
   <function>set_result</function>,
   and
   <function>unset_result</function>
   allow you to handle multiple result sets at the same time.
d132 2
a133 2
   There are several demonstration programs in the
   source directory.
@


2.7
log
@Fix wording.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql/doc/src/sgml/libpgeasy.sgml,v 2.6 2001/09/10 21:58:46 petere Exp $
d5 2
a6 2
 <chapter id="pgeasy-chapter">
  <title id="pgeasy"><application>libpgeasy</application> - Simplified C Library</title>
d19 4
a22 3
   <productname>pgeasy</productname> allows you to cleanly interface
   to the <productname>libpq</productname> library,
   more like a 4GL SQL interface.
d115 2
a116 2
   cursors can not be used if you are running the
   <productname>pgeasy</productname>
@


2.6
log
@Markup and spell-check run over Programmer's Guide (rather incomplete still).
@
text
@d2 1
a2 1
$Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/libpgeasy.sgml,v 2.5 2001/04/20 15:52:33 thomas Exp $
d135 1
a135 1
   There are a variety of demonstration programs in the
@


2.5
log
@Final markup for 7.1 hardcopy release. Mostly typo and table-fitting
 adjustments. Note that many tables are being abused with *really* long
 description columns. Should probably shrink those columns to be more
 concise, and move some of the info to follow-on reference notes.
@
text
@d2 1
a2 1
$Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/libpgeasy.sgml,v 2.4 2000/12/22 21:51:58 petere Exp $
d6 1
a6 1
  <title id="pgeasy">libpgeasy - Simplified C Library</title>
d26 1
a26 1
   functionality of libpq.
d31 1
a31 1
     <para>
d33 1
a33 1
     </para>
d37 1
a37 1
     <para>
d39 1
a39 1
     </para>
d43 1
a43 1
     <para>
d45 1
a45 1
     </para>
d49 1
a49 1
     <para>
d51 1
a51 1
     </para>
d55 1
a55 1
     <para>
d57 1
a57 1
     </para>
d61 1
a61 1
     <para>
d63 1
a63 1
     </para>
d67 1
a67 1
     <para>
d69 1
a69 1
     </para>
d73 1
a73 1
     <para>
d75 1
a75 1
     </para>
d79 1
a79 1
     <para>
d81 1
a81 1
     </para>
d85 1
a85 1
     <para>
d87 1
a87 1
     </para>
d91 1
a91 1
     <para>
d93 1
a93 1
     </para>
d121 1
a121 1
   You can always use libpq functions on the PGresult pointer returned
@


2.4
log
@Make use of <email> tag for marking up email addresses.
@
text
@d2 1
a2 1
$Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/libpgeasy.sgml,v 2.3 2000/05/18 14:24:31 momjian Exp $
d6 1
a6 1
  <title id="pgeasy">libpgeasy - Simplified C Binding Library</title>
@


2.3
log
@Fix WARN->NOTICE in docs.  Change libpgeasy connection parameters to use
PQconnectdb() style connections.
@
text
@d2 1
a2 1
$Header: /usr/local/cvsroot/pgsql/doc/src/sgml/libpgeasy.sgml,v 2.2 2000/04/27 18:45:43 momjian Exp $
d13 2
a14 2
    (<ulink url="mailto:pgman@@candle.pha.pa.us">pgman@@candle.pha.pa.us</ulink>)
    and last updated 2000-03-30.
@


2.2
log
@Update libpgeasy e-mail address
@
text
@d2 1
a2 1
$Header: /usr/local/cvsroot/pgsql/doc/src/sgml/libpgeasy.sgml,v 2.1 2000/03/31 03:26:21 thomas Exp $
d38 1
a38 1
PGconn     *connectdb();
d111 1
a111 1
   For <literal>select</literal> queries, <function>fetch</function>
@


2.1
log
@Add Bruce's pgeasy doc from the man page.
@
text
@d2 1
a2 1
$Header$
d13 1
a13 1
    (<ulink url="mailto:root@@candle.pha.pa.us">root@@candle.pha.pa.us</ulink>)
@
