| PostgreSQL Reference Manual - Volume 2 - Programming Guide by The PostgreSQL Global Development Group Paperback (6"x9"), 408 pages ISBN 0954612035 RRP £19.95 ($34.95) Sales of this book support the PostgreSQL project! Get a printed copy>>> |
2.3.1 Creating a Large Object
The function
Oid lo_creat(PGconn *conn, int mode);
creates a new large object.
The return value is the OID that was assigned to the new large object,
or InvalidOid (zero) on failure.
mode is unused and
ignored as of PostgreSQL 8.1; however, for
backwards compatibility with earlier releases it is best to
set it to INV_READ, INV_WRITE,
or INV_READ | INV_WRITE.
(These symbolic constants are defined
in the header file ‘libpq/libpq-fs.h’.)
An example:
inv_oid = lo_creat(conn, INV_READ|INV_WRITE);
The function
Oid lo_create(PGconn *conn, Oid lobjId);
also creates a new large object. The OID to be assigned can be
specified by lobjId;
if so, failure occurs if that OID is already in use for some large
object. If lobjId
is InvalidOid (zero) then lo_create assigns an unused
OID (this is the same behavior as lo_creat).
The return value is the OID that was assigned to the new large object,
or InvalidOid (zero) on failure.
lo_create is new as of PostgreSQL
8.1; if this function is run against an older server version, it will
fail and return InvalidOid.
An example:
inv_oid = lo_create(conn, desired_oid);
| ISBN 0954612035 | PostgreSQL Reference Manual - Volume 2 - Programming Guide | See the print edition |