Chapter 18. pgtcl

Table of Contents
コマンド
pgtcl コマンドレファレンス情報

pgtcl is a tcl package for front-end programs to interface with Postgres backends. It makes most of the functionality of libpq available to tcl scripts.

pgtcl は、Postgres バッ クエンドとインタフェースを持つフロントエンドプログラム用の tcl パッケ ージです。これにより libpq のほとんどの機能を tcl スクリプトから使用できるようになります。

This package was originally written by Jolly Chen.

このパッケージは元々 Jolly Chen 氏によって作成されたものです。

コマンド

Table 18-1. pgtcl コマンド

コマンド説明
pg_connectバックエンドサーバとの接続を開く
pg_disconnect接続を閉じる
pg_conndefaults接続オプションとそのデフォルト値を得る
pg_execバックエンドに問い合わせを送信する
pg_result問い合わせの結果を操作する
pg_selectSELECT 文の結果を繰り返し処理する
pg_listenNOTIFY メッセージ用のコールバックを確立する
pg_lo_creatラージオブジェクトを作成する
pg_lo_openラージオブジェクトを開く
pg_lo_closeラージオブジェクトを閉じる
pg_lo_readラージオブジェクトを読む
pg_lo_writeラージオブジェクトに書き込む
pg_lo_lseekラージオブジェクトの位置をシークする
pg_lo_tellラージオブジェクトの現在のシーク位置を返す
pg_lo_unlinkラージオブジェクトを削除する
pg_lo_importUnix ファイルをラージオブジェクトにインポートする
pg_lo_export ラージオブジェクトを Unix ファイルにエキスポートする

These commands are described further on subsequent pages.

これらのコマンドの詳細は下で記述します。

The pg_lo* routines are interfaces to the Large Object features of Postgres. The functions are designed to mimic the analogous file system functions in the standard Unix file system interface. The pg_lo* routines should be used within a BEGIN/END transaction block because the file descriptor returned by pg_lo_open is only valid for the current transaction. pg_lo_import and pg_lo_export MUST be used in a BEGIN/END transaction block.

pg_lo* 処理は Postgres のラージオブジェク ト機能へのインタフェースです。それらの関数は標準的な Unix ファイルシ ステムインタフェース用のファイルシステム関数を真似して設計されていま す。pg_lo_openで返されるファイル記述子が現時点のトランザクションに対 してのみ効力を持っていますので、pg_lo* 処理は BEGIN/END トランザクシ ョンブロックの中で使用されなければなりません。特に、pg_lo_import と pg_lo_export は必ず BEGIN/END トランザクションブロック内で使わなけれ ばいけません。