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

第59章 外部データラッパーの作成

目次

59.1. 外部データラッパー関数
59.2. 外部データラッパーのコールバックルーチン
59.2.1. 外部テーブルスキャンのためのFDWルーチン
59.2.2. 外部テーブルの結合をスキャンするためのFDWルーチン
59.2.3. スキャン/結合後の処理をプラン生成するためのFDWルーチン
59.2.4. 外部テーブル更新のためのFDWルーチン
59.2.5. TRUNCATEのためのFDWルーチン
59.2.6. 行ロックのためのFDWルーチン
59.2.7. EXPLAINのためのFDWルーチン
59.2.8. ANALYZEのためのFDWルーチン
59.2.9. IMPORT FOREIGN SCHEMAのためのFDWルーチン
59.2.10. パラレル実行のためのFDWルーチン
59.2.11. 非同期実行のためのFDWルーチン
59.2.12. パスの再パラメータ化のためのFDWルーチン
59.3. 外部データラッパーヘルパ関数
59.4. 外部データラッパーの問い合わせプラン作成
59.5. 外部データラッパーでの行ロック
<title>Writing a Foreign Data Wrapper</title>

All operations on a foreign table are handled through its foreign data wrapper, which consists of a set of functions that the core server calls. The foreign data wrapper is responsible for fetching data from the remote data source and returning it to the <productname>PostgreSQL</productname> executor. If updating foreign tables is to be supported, the wrapper must handle that, too. This chapter outlines how to write a new foreign data wrapper. 外部テーブルへの全ての操作は、コアサーバから呼び出される関数のセットで構成される、外部データラッパーで処理されます。 外部データラッパーは、リモートデータソースからデータを取り出し、そのデータをPostgreSQLエグゼキュータに返却することを担当します。 外部テーブルの更新をサポートする場合、ラッパーはそれも扱わなければなりません。 本章では、新しい外部データラッパーを作成する方法の概要を示します。

The foreign data wrappers included in the standard distribution are good references when trying to write your own. Look into the <filename>contrib</filename> subdirectory of the source tree. The <xref linkend="sql-createforeigndatawrapper"/> reference page also has some useful details. 独自の外部データラッパーを作成する際、標準配布物に含まれているものは優れたリファレンスです。 ソースツリーのcontribサブディレクトリを調べてください。 CREATE FOREIGN DATA WRAPPERマニュアルページにも有用な情報があります。

注記

The SQL standard specifies an interface for writing foreign data wrappers. However, PostgreSQL does not implement that API, because the effort to accommodate it into PostgreSQL would be large, and the standard API hasn't gained wide adoption anyway. 標準SQLでは外部データラッパーを作成するインタフェースを定義しています。 しかしながら、PostgreSQLに適応させる労力が大きく、また標準のAPIが広く採用されているわけでもないので、PostgreSQLはそのAPIを実装していません。