From 8436f9a0364a6a16dbf7b250597986a97c9e6f09 Mon Sep 17 00:00:00 2001 From: Tatsuo Ishii Date: Wed, 19 Mar 2008 00:39:33 +0000 Subject: Add libpq new API lo_import_with_oid() which is similar to lo_import() except that lob's oid can be specified. --- doc/src/sgml/lobj.sgml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'doc/src') diff --git a/doc/src/sgml/lobj.sgml b/doc/src/sgml/lobj.sgml index 0c60988f259..69a21c99cf7 100644 --- a/doc/src/sgml/lobj.sgml +++ b/doc/src/sgml/lobj.sgml @@ -1,4 +1,4 @@ - + Large Objects @@ -161,6 +161,28 @@ Oid lo_import(PGconn *conn, const char *filename); the server; so it must exist in the client file system and be readable by the client application. + + + The function + +Oid lo_import_with_oid(PGconn *conn, const char *filename, Oid lobjId); + + lo_import_with_oid + also imports 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_import_with_oid assigns an unused + OID (this is the same behavior as lo_import). + The return value is the OID that was assigned to the new large object, + or InvalidOid (zero) on failure. + + + + lo_import_with_oid is new as of PostgreSQL + 8.4 and uses lo_create internally which is new in 8.1; if this function is run against 8.0 or before, it will + fail and return InvalidOid. + -- cgit v1.2.3