2 33.2. Implementation Features #
4 The large object implementation breaks large objects up into “chunks”
5 and stores the chunks in rows in the database. A B-tree index
6 guarantees fast searches for the correct chunk number when doing random
7 access reads and writes.
9 The chunks stored for a large object do not have to be contiguous. For
10 example, if an application opens a new large object, seeks to offset
11 1000000, and writes a few bytes there, this does not result in
12 allocation of 1000000 bytes worth of storage; only of chunks covering
13 the range of data bytes actually written. A read operation will,
14 however, read out zeroes for any unallocated locations preceding the
15 last existing chunk. This corresponds to the common behavior of
16 “sparsely allocated” files in Unix file systems.
18 As of PostgreSQL 9.0, large objects have an owner and a set of access
19 permissions, which can be managed using GRANT and REVOKE. SELECT
20 privileges are required to read a large object, and UPDATE privileges
21 are required to write or truncate it. Only the large object's owner (or
22 a database superuser) can delete, comment on, or change the owner of a
23 large object. To adjust this behavior for compatibility with prior
24 releases, see the lo_compat_privileges run-time parameter.