バージョンごとのドキュメント一覧

第34章 libpq — C ライブラリ

目次

34.1. データベース接続制御関数
34.1.1. 接続文字列
34.1.2. パラメータキーワード
34.2. 接続状態関数
34.3. コマンド実行関数
34.3.1. 主要な関数
34.3.2. 問い合わせ結果の情報の取り出し
34.3.3. 他の結果情報の取り出し
34.3.4. SQLコマンドに含めるための文字列のエスケープ処理
34.4. 非同期コマンドの処理
34.5. パイプラインモード
34.5.1. パイプラインモードの使用
34.5.2. パイプラインモード関連関数
34.5.3. いつパイプラインモードを使用するか
34.6. 1行1行問い合わせ結果を受け取る
34.7. 処理中の問い合わせのキャンセル
34.8. 近道インタフェース
34.9. 非同期通知
34.10. COPYコマンド関連関数
34.10.1. COPYデータ送信用関数
34.10.2. COPYデータ受信用関数
34.10.3. 廃れたCOPY用関数
34.11. 制御関数
34.12. 雑多な関数
34.13. 警告処理
34.14. イベントシステム
34.14.1. イベントの種類
34.14.2. イベントコールバックプロシージャ
34.14.3. イベントサポート関数
34.14.4. イベント事例
34.15. 環境変数
34.16. パスワードファイル
34.17. 接続サービスファイル
34.18. 接続パラメータのLDAP検索
34.19. SSLサポート
34.19.1. サーバ証明書のクライアント検証
34.19.2. クライアント証明書
34.19.3. 異なるモードで提供される保護
34.19.4. SSLクライアントファイル使用方法
34.19.5. SSLライブラリの初期化
34.20. スレッド化プログラムの振舞い
34.21. libpqプログラムの構築
34.22. サンプルプログラム
<title><application>libpq</application> &mdash; C Library</title>

<application>libpq</application> is the <acronym>C</acronym> application programmer's interface to <productname>PostgreSQL</productname>. <application>libpq</application> is a set of library functions that allow client programs to pass queries to the <productname>PostgreSQL</productname> backend server and to receive the results of these queries. libpqは、C言語によるアプリケーションプログラマ用のPostgreSQLインタフェースです。 libpqは、クライアントプログラムからPostgreSQLのバックエンドサーバに問い合わせを渡し、その結果を受け取るためのライブラリ関数の集合です。

<application>libpq</application> is also the underlying engine for several other <productname>PostgreSQL</productname> application interfaces, including those written for C++, Perl, Python, Tcl and <application>ECPG</application>. So some aspects of <application>libpq</application>'s behavior will be important to you if you use one of those packages. In particular, <xref linkend="libpq-envars"/>, <xref linkend="libpq-pgpass"/> and <xref linkend="libpq-ssl"/> describe behavior that is visible to the user of any application that uses <application>libpq</application>. libpqは、C++、Perl、Python、Tcl、ECPGなどを含む、PostgreSQLの他の各種アプリケーションインタフェースを支えるエンジンでもあります。 従って、libpqの動作は、これらのパッケージを使用する人にとって重要なものになります。 特に、34.1534.16および34.19にて、libpqを使用するすべてのアプリケーションのユーザから見える動作を説明します。

Some short programs are included at the end of this chapter (<xref linkend="libpq-example"/>) to show how to write programs that use <application>libpq</application>. There are also several complete examples of <application>libpq</application> applications in the directory <filename>src/test/examples</filename> in the source code distribution. 本章の最後に、libpqの使い方を示す、いくつかの短いプログラム(34.22)があります。 また、ソースコード配布物内のsrc/test/examplesディレクトリに、libpqを利用したアプリケーションプログラム一式の例があります。

Client programs that use <application>libpq</application> must include the header file <filename>libpq-fe.h</filename><indexterm><primary>libpq-fe.h</primary></indexterm> and must link with the <application>libpq</application> library. libpqを使用してフロントエンドプログラムを作成するには、libpq-fe.hヘッダファイルのインクルードと、libpq ライブラリとのリンクが必要です。

split-libpq0-end split-libpq1-start split-libpq1-end split-libpq2-start split-libpq2-end split-libpq3-start