bool pg_loexport
(int
oid, int
file [, int
connection_id])
The oid argument specifies the object id of the large object to export and the filename argument specifies the pathname of the file. Returns FALSE if an error occurred, TRUE otherwise. Remember that handling large objects in PostgreSQL must happen inside a transaction.