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 and Section 5.6.