]> begriffs open source - ai-pg/blob - full-docs/src/sgml/html/libpq.html
WIP: toc builder
[ai-pg] / full-docs / src / sgml / html / libpq.html
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 32. libpq — C Library</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="client-interfaces.html" title="Part IV. Client Interfaces" /><link rel="next" href="libpq-connect.html" title="32.1. Database Connection Control Functions" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">Chapter 32. <span class="application">libpq</span> — C Library</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="client-interfaces.html" title="Part IV. Client Interfaces">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="client-interfaces.html" title="Part IV. Client Interfaces">Up</a></td><th width="60%" align="center">Part IV. Client Interfaces</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="libpq-connect.html" title="32.1. Database Connection Control Functions">Next</a></td></tr></table><hr /></div><div class="chapter" id="LIBPQ"><div class="titlepage"><div><div><h2 class="title">Chapter 32. <span class="application">libpq</span> — C Library</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="sect1"><a href="libpq-connect.html">32.1. Database Connection Control Functions</a></span></dt><dd><dl><dt><span class="sect2"><a href="libpq-connect.html#LIBPQ-CONNSTRING">32.1.1. Connection Strings</a></span></dt><dt><span class="sect2"><a href="libpq-connect.html#LIBPQ-PARAMKEYWORDS">32.1.2. Parameter Key Words</a></span></dt></dl></dd><dt><span class="sect1"><a href="libpq-status.html">32.2. Connection Status Functions</a></span></dt><dt><span class="sect1"><a href="libpq-exec.html">32.3. Command Execution Functions</a></span></dt><dd><dl><dt><span class="sect2"><a href="libpq-exec.html#LIBPQ-EXEC-MAIN">32.3.1. Main Functions</a></span></dt><dt><span class="sect2"><a href="libpq-exec.html#LIBPQ-EXEC-SELECT-INFO">32.3.2. Retrieving Query Result Information</a></span></dt><dt><span class="sect2"><a href="libpq-exec.html#LIBPQ-EXEC-NONSELECT">32.3.3. Retrieving Other Result Information</a></span></dt><dt><span class="sect2"><a href="libpq-exec.html#LIBPQ-EXEC-ESCAPE-STRING">32.3.4. Escaping Strings for Inclusion in SQL Commands</a></span></dt></dl></dd><dt><span class="sect1"><a href="libpq-async.html">32.4. Asynchronous Command Processing</a></span></dt><dt><span class="sect1"><a href="libpq-pipeline-mode.html">32.5. Pipeline Mode</a></span></dt><dd><dl><dt><span class="sect2"><a href="libpq-pipeline-mode.html#LIBPQ-PIPELINE-USING">32.5.1. Using Pipeline Mode</a></span></dt><dt><span class="sect2"><a href="libpq-pipeline-mode.html#LIBPQ-PIPELINE-FUNCTIONS">32.5.2. Functions Associated with Pipeline Mode</a></span></dt><dt><span class="sect2"><a href="libpq-pipeline-mode.html#LIBPQ-PIPELINE-TIPS">32.5.3. When to Use Pipeline Mode</a></span></dt></dl></dd><dt><span class="sect1"><a href="libpq-single-row-mode.html">32.6. Retrieving Query Results in Chunks</a></span></dt><dt><span class="sect1"><a href="libpq-cancel.html">32.7. Canceling Queries in Progress</a></span></dt><dd><dl><dt><span class="sect2"><a href="libpq-cancel.html#LIBPQ-CANCEL-FUNCTIONS">32.7.1. Functions for Sending Cancel Requests</a></span></dt><dt><span class="sect2"><a href="libpq-cancel.html#LIBPQ-CANCEL-DEPRECATED">32.7.2. Obsolete Functions for Sending Cancel Requests</a></span></dt></dl></dd><dt><span class="sect1"><a href="libpq-fastpath.html">32.8. The Fast-Path Interface</a></span></dt><dt><span class="sect1"><a href="libpq-notify.html">32.9. Asynchronous Notification</a></span></dt><dt><span class="sect1"><a href="libpq-copy.html">32.10. Functions Associated with the <code class="command">COPY</code> Command</a></span></dt><dd><dl><dt><span class="sect2"><a href="libpq-copy.html#LIBPQ-COPY-SEND">32.10.1. Functions for Sending <code class="command">COPY</code> Data</a></span></dt><dt><span class="sect2"><a href="libpq-copy.html#LIBPQ-COPY-RECEIVE">32.10.2. Functions for Receiving <code class="command">COPY</code> Data</a></span></dt><dt><span class="sect2"><a href="libpq-copy.html#LIBPQ-COPY-DEPRECATED">32.10.3. Obsolete Functions for <code class="command">COPY</code></a></span></dt></dl></dd><dt><span class="sect1"><a href="libpq-control.html">32.11. Control Functions</a></span></dt><dt><span class="sect1"><a href="libpq-misc.html">32.12. Miscellaneous Functions</a></span></dt><dt><span class="sect1"><a href="libpq-notice-processing.html">32.13. Notice Processing</a></span></dt><dt><span class="sect1"><a href="libpq-events.html">32.14. Event System</a></span></dt><dd><dl><dt><span class="sect2"><a href="libpq-events.html#LIBPQ-EVENTS-TYPES">32.14.1. Event Types</a></span></dt><dt><span class="sect2"><a href="libpq-events.html#LIBPQ-EVENTS-PROC">32.14.2. Event Callback Procedure</a></span></dt><dt><span class="sect2"><a href="libpq-events.html#LIBPQ-EVENTS-FUNCS">32.14.3. Event Support Functions</a></span></dt><dt><span class="sect2"><a href="libpq-events.html#LIBPQ-EVENTS-EXAMPLE">32.14.4. Event Example</a></span></dt></dl></dd><dt><span class="sect1"><a href="libpq-envars.html">32.15. Environment Variables</a></span></dt><dt><span class="sect1"><a href="libpq-pgpass.html">32.16. The Password File</a></span></dt><dt><span class="sect1"><a href="libpq-pgservice.html">32.17. The Connection Service File</a></span></dt><dt><span class="sect1"><a href="libpq-ldap.html">32.18. LDAP Lookup of Connection Parameters</a></span></dt><dt><span class="sect1"><a href="libpq-ssl.html">32.19. SSL Support</a></span></dt><dd><dl><dt><span class="sect2"><a href="libpq-ssl.html#LIBQ-SSL-CERTIFICATES">32.19.1. Client Verification of Server Certificates</a></span></dt><dt><span class="sect2"><a href="libpq-ssl.html#LIBPQ-SSL-CLIENTCERT">32.19.2. Client Certificates</a></span></dt><dt><span class="sect2"><a href="libpq-ssl.html#LIBPQ-SSL-PROTECTION">32.19.3. Protection Provided in Different Modes</a></span></dt><dt><span class="sect2"><a href="libpq-ssl.html#LIBPQ-SSL-FILEUSAGE">32.19.4. SSL Client File Usage</a></span></dt><dt><span class="sect2"><a href="libpq-ssl.html#LIBPQ-SSL-INITIALIZE">32.19.5. SSL Library Initialization</a></span></dt></dl></dd><dt><span class="sect1"><a href="libpq-oauth.html">32.20. OAuth Support</a></span></dt><dd><dl><dt><span class="sect2"><a href="libpq-oauth.html#LIBPQ-OAUTH-AUTHDATA-HOOKS">32.20.1. Authdata Hooks</a></span></dt><dt><span class="sect2"><a href="libpq-oauth.html#LIBPQ-OAUTH-DEBUGGING">32.20.2. Debugging and Developer Settings</a></span></dt></dl></dd><dt><span class="sect1"><a href="libpq-threading.html">32.21. Behavior in Threaded Programs</a></span></dt><dt><span class="sect1"><a href="libpq-build.html">32.22. Building <span class="application">libpq</span> Programs</a></span></dt><dt><span class="sect1"><a href="libpq-example.html">32.23. Example Programs</a></span></dt></dl></div><a id="id-1.7.3.2" class="indexterm"></a><a id="id-1.7.3.3" class="indexterm"></a><p>
3   <span class="application">libpq</span> is the <acronym class="acronym">C</acronym>
4   application programmer's interface to <span class="productname">PostgreSQL</span>.
5   <span class="application">libpq</span> is a set of library functions that allow
6   client programs to pass queries to the <span class="productname">PostgreSQL</span>
7   backend server and to receive the results of these queries.
8  </p><p>
9   <span class="application">libpq</span> is also the underlying engine for several
10   other <span class="productname">PostgreSQL</span> application interfaces, including
11   those written for C++, Perl, Python, Tcl and <span class="application">ECPG</span>.
12   So some aspects of <span class="application">libpq</span>'s behavior will be
13   important to you if you use one of those packages.  In particular,
14   <a class="xref" href="libpq-envars.html" title="32.15. Environment Variables">Section 32.15</a>,
15   <a class="xref" href="libpq-pgpass.html" title="32.16. The Password File">Section 32.16</a> and
16   <a class="xref" href="libpq-ssl.html" title="32.19. SSL Support">Section 32.19</a>
17   describe behavior that is visible to the user of any application
18   that uses <span class="application">libpq</span>.
19  </p><p>
20   Some short programs are included at the end of this chapter (<a class="xref" href="libpq-example.html" title="32.23. Example Programs">Section 32.23</a>) to show how
21   to write programs that use <span class="application">libpq</span>.  There are also several
22   complete examples of <span class="application">libpq</span> applications in the
23   directory <code class="filename">src/test/examples</code> in the source code distribution.
24  </p><p>
25   Client programs that use <span class="application">libpq</span> must
26   include the header file
27   <code class="filename">libpq-fe.h</code><a id="id-1.7.3.7.3" class="indexterm"></a>
28   and must link with the <span class="application">libpq</span> library.
29  </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="client-interfaces.html" title="Part IV. Client Interfaces">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="client-interfaces.html" title="Part IV. Client Interfaces">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="libpq-connect.html" title="32.1. Database Connection Control Functions">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Part IV. Client Interfaces </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="40%" align="right" valign="top"> 32.1. Database Connection Control Functions</td></tr></table></div></body></html>