Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
f3e1937e
Commit
f3e1937e
authored
22 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
Move libpgeasy.sgml to gborg.
parent
9761f1a0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/src/sgml/libpgeasy.sgml
+0
-152
0 additions, 152 deletions
doc/src/sgml/libpgeasy.sgml
with
0 additions
and
152 deletions
doc/src/sgml/libpgeasy.sgml
deleted
100644 → 0
+
0
−
152
View file @
9761f1a0
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/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:
-->
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment