Postgresql 中文操作指南

53.30. pg_largeobject #

目录_pg_largeobject_持有构成“大型对象”的数据。一个大型对象由在创建时分配的OID标识。每个大型对象被分解成足够小的区段或“页”,以便作为_pg_largeobject_中的行方便存储。每页的数据量被定义为_LOBLKSIZE_(目前为_BLCKSZ/4_,一般为2kB)。

The catalog pg_largeobject holds the data making up “large objects”. A large object is identified by an OID assigned when it is created. Each large object is broken into segments or “pages” small enough to be conveniently stored as rows in pg_largeobject. The amount of data per page is defined to be LOBLKSIZE (which is currently BLCKSZ/4, or typically 2 kB).

在 PostgreSQL 9.0 之前,没有与大对象关联的权限结构。因此, pg_largeobject 可以公开读取,并且可用于获取系统中所有大对象的 OID(及内容)。不再是这样;使用 pg_largeobject_metadata 获取大对象 OID 列表。

Prior to PostgreSQL 9.0, there was no permission structure associated with large objects. As a result, pg_largeobject was publicly readable and could be used to obtain the OIDs (and contents) of all large objects in the system. This is no longer the case; use pg_largeobject_metadata to obtain a list of large object OIDs.

Table 53.30. pg_largeobject Columns

Table 53.30. pg_largeobject Columns

Column Type

Description

loid oid (references pg_largeobject_metadata.oid)

Identifier of the large object that includes this page

pageno int4

Page number of this page within its large object (counting from zero)

data bytea

Actual data stored in the large object. This will never be more than LOBLKSIZE bytes and might be less.

pg_largeobject_的每一行都保存一个大型对象的页的数据,始于对象中字节偏移(_pageno * LOBLKSIZE)。该实现允许稀疏存储:页可能丢失,甚至如果不是对象的最后一页,也可能短于_LOBLKSIZE_字节。大型对象内的区域丢失时读取为零。

Each row of pg_largeobject holds data for one page of a large object, beginning at byte offset (pageno * LOBLKSIZE) within the object. The implementation allows sparse storage: pages might be missing, and might be shorter than LOBLKSIZE bytes even if they are not the last page of the object. Missing regions within a large object read as zeroes.