Database Reference
In-Depth Information
Functions for large objects
must
be called in a
transaction block
,
so when autocommit is off, make sure that you issue the
BEGIN
command explicitly.
Large objects in action
Now is the time to get some hands-on practice with large objects.
In this section, you will play with large objects using server functions in your SQL
statements. In the following section, you will be exposed to access large objects
through the
libpq
client interface library.
Let's search PostgreSQL for the list of functions available to access large objects:
postgres=# SELECT n.nspname as "Schema", p.proname as "Name",
pg_catalog.pg_get_function_result(p.oid) as "Result
data type", pg_catalog.pg_get_function_arguments(p.oid)
as "Argument data types"
FROM pg_catalog.pg_proc p LEFT JOIN
pg_catalog.pg_namespace n ON n.oid = p.pronamespace
WHERE p.proname ~ '^(lo_.*)$'AND
pg_catalog.pg_function_is_visible(p.oid)
ORDER BY 1, 2, 4;
List of functions
Schema | Name | Result data type | Argument data
| | | types
------------+---------------+------------------+-----------------
pg_catalog | lo_close | integer | integer
pg_catalog | lo_create | oid | integer
pg_catalog | lo_create | oid | oid
pg_catalog | lo_export | integer | oid, text
pg_catalog | lo_import | oid | text
pg_catalog | lo_import | oid | text, oid
pg_catalog | lo_lseek | integer | integer, integer,
| | | integer
pg_catalog | lo_lseek64 | bigint | integer, bigint,
| | | integer
pg_catalog | lo_open | integer | oid, integer
pg_catalog | lo_tell | integer | integer
pg_catalog | lo_tell64 | bigint | integer
pg_catalog | lo_truncate | integer | integer, integer
pg_catalog | lo_truncate64 | integer | integer, bigint
pg_catalog | lo_unlink | integer | oid
(14 rows)