4.6. Large Object Processing Commands

pg_lo_creat — Create a large object
pg_lo_open — Open a large object
pg_lo_close — Close a large object
pg_lo_read — Read from a large object
pg_lo_write — Write to a large object
pg_lo_lseek — Seek to a position of a large object
pg_lo_tell — Return the current seek position of a large object
pg_lo_unlink — Delete a large object
pg_lo_import — Import a large object from a file
pg_lo_export — Export a large object to a file

Abstract

The commands in this section are used to create and work with PostgreSQL Large Objects. For more information about Large Objects, refer to the PostgreSQL reference manual, Client Interfaces, Large Objects chapter.

Note

The Large Object commands must be used within a transaction block, beginning with BEGIN and ending with COMMIT or ROLLBACK. This is because the large object file descriptors (returned by pg_lo_open) are only valid for the current transaction.

Examples of Large Object commands can be found in Section 5.5, “Example - Large Objects - Picture Viewer, Part 1 - Store Pictures” and Section 5.6, “Example - Large Objects - Picture Viewer, Part 2 - View Pictures”.