Large object

A special data type which provides stream-style access to data which is too large to manipulate as a whole

A large object is a special data type which provides stream-style access to data which is too large to manipulate as a whole.

A large object can contain up to 4TB of data, compared to the maximum 1GB available with conventional data types via the TOAST mechanism.

Usage

Large objects differ from normal database objects in that they are not manipulated via SQL commands (with the exception of ownership and permissions metadata); instead PostgreSQL provides (via libpq) an API with which they can be uploaded, downloaded and removed. Actual implementation of a user-accessible interface is left to individual applications or database drivers. psql provides basic commands for manipulating them.

SQL command

psql commands

  • \lo_export LOBOID FILE
  • \lo_import FILE [COMMENT]
  • \lo_list
  • \lo_unlink LOBOID

Client utilities

Contrib modules

Categories

Data type, Large object, Storage

See also

pg_largeobject, pg_largeobject_metadata