postgresql_16:5.2.3 Client Interfaces
PostgreSQL 16 > Client Interfaces > Large Objects > Client Interfaces
This section describes the facilities that PostgreSQL's libpq client interface library provides for accessing large objects. The PostgreSQL large object interface is modeled after the Unix file-system interface, with analogues of open, read, write, lseek, etc.
All large object manipulation using these functions *must* take place within an SQL transaction block, since large object file descriptors are only valid for the duration of a transaction. Write operations, including lo_open with the INV_WRITE mode, are not allowed in a read-only transaction.
If an error occurs while executing any one of these functions, the function will return an otherwise-impossible value, typically 0 or -1. A message describing the error is stored in the connection object and can be retrieved with (see libpq-PQerrorMessage).
Client applications that use these functions should include the header file libpq/libpq-fs.h and link with the libpq library.
Client applications cannot use these functions while a libpq connection is in pipeline mode.
Subsections
- postgresql_16:5.2.3.1 Creating a Large Object
- postgresql_16:5.2.3.2 Importing a Large Object
- postgresql_16:5.2.3.3 Exporting a Large Object
- postgresql_16:5.2.3.4 Opening an Existing Large Object
- postgresql_16:5.2.3.5 Writing Data to a Large Object
- postgresql_16:5.2.3.6 Reading Data from a Large Object
- postgresql_16:5.2.3.7 Seeking in a Large Object
- postgresql_16:5.2.3.8 Obtaining the Seek Position of a Large Object
- postgresql_16:5.2.3.9 Truncating a Large Object
- postgresql_16:5.2.3.10 Closing a Large Object Descriptor
- postgresql_16:5.2.3.11 Removing a Large Object