Chapter 15. ラージオブジェクト

Table of Contents
歴史的な補遺
転置ラージオブジェクト
ラージオブジェクト・インタフェース
組み込み済みの登録された関数
LIBPQ からのラージオブジェクトへのアクセス
サンプルプログラム

In Postgres, data values are stored in tuples and individual tuples cannot span data pages. Since the size of a data page is 8192 bytes, the upper limit on the size of a data value is relatively low. To support the storage of larger atomic values, Postgres provides a large object interface. This interface provides file oriented access to user data that has been declared to be a large type. This section describes the implementation and the programmatic and query language interfaces to Postgres large object data.

Postgres では、データ値はタプルに格 納されます。各タプルは複数のデータページに跨ることはできません。 データページの大きさは 8192 バイトであることから、あまり大きな データ値を入れることができません。。より大きい原子値の格納 をサポートするために Postgres はラー ジオブジェクト・インタフェースを提供します。このインタフェース では、ラージ型と宣言されたユーザデータへのファイル指向のアクセ スを提供しています。この節では、その実装とプログラム作成方法、 Postgres ラージオブジェクト・データ への問い合わせ言語インタフェースについて説明します。

歴史的な補遺

Originally, Postgres 4.2 supported three standard implementations of large objects: as files external to Postgres, as ym>Uym> files managed by Postgres, and as data stored within the Postgres database. It causes considerable confusion among users. As a result, we only support large objects as data stored within the Postgres database in PostgreSQL. Even though it is slower to access, it provides stricter data integrity. For historical reasons, this storage scheme is referred to as Inversion large objects. (We will use Inversion and large objects interchangeably to mean the same thing in this section.)

当初、Postgres 4.2 ではラージオブジ ェクトに関して、3 つの標準的な実装をサポートしていました。すな わち、Postgres の外部ファイル、 Postgres で管理される Unix ファイル、 Postgres データベースに格納されるデ ータの 3 つです。 (訳注: 原文では <acronym>ym>U</acronym>ym>とな っていました。古い版では <acronym>Unix</acronym>と なっていましたたので、上のように記述しています。) これはかなりユーザの混乱を招きました。この結果、 PostgreSQL においては、 PostgreSQL データベースに格納される データのみをサポートするようにしました。これによってアクセスが より遅くなりましたが、より厳密に一貫性を持ったデータを提供する ようになりました。歴史的な理由により、この格納の仕組みは転置ラ ージオブジェクトと呼ばれています。(この節では、どちらも同じ意 味を持っていますので「転置」と「ラージオブジェクト」のどちらも 使っています。)