Database Reference
In-Depth Information
However, the user table still contains the row and if you try to run the lo_unlink()
function again, it will prompt you with a meaningful message that your large object
does not exist.
Use SELECT on the test_large_objects table as follows:
postgres=# SELECT * from test_large_objects;
picture_id | name | picture_loc
------------+----------------+-------------
1 | pg_disney_trip | 74441
(1 row)
Use the lo_unlink() function as follows:
postgres=# SELECT lo_unlink(74441);
ERROR: large object 74441 does not exist
Manipulating large objects through the
libpq client interface library
PostgreSQL provides multiple ways to store and access large objects. The
PostgreSQL libpq client interface library helps you access the large objects
with ease and eficiency.
This section will give you an overview of some of the main functions, their usage as
per the online PostgreSQL manual, and their usage in code examples crafted for you.
For a detailed reference, you can refer to the online PostgreSQL documentation,
available at http://www.postgresql.org/docs/9.4/static/lo-interfaces.html .
When using these functions in client applications, include the
libpq/libpq-fs.h header ile and link with the libpq library.
We have designed two examples in the C programming language for you; the
irst example will demonstrate importing and exporting using the libpq library
and the second will focus on accessing via the open, write, read, close, and unlink
functionalities using the libpq client interface. Let's go through each functionality
one by one.
 
Search WWH ::




Custom Search