Use lo_creat() instead of lo_create() when creating large objects without new_oid.

This enhances the compatibility with the pgpool-II replication middleware,
that doesn't support lo_create() calls.
This commit is contained in:
Giovanni Mascellani 2012-01-09 23:32:36 +01:00 committed by Daniele Varrazzo
parent dcc60131a9
commit e1700fe28b

View File

@ -175,7 +175,10 @@ lobject_open(lobjectObject *self, connectionObject *conn,
if (new_file)
self->oid = lo_import(self->conn->pgconn, new_file);
else
self->oid = lo_create(self->conn->pgconn, new_oid);
if (new_oid != InvalidOid)
self->oid = lo_create(self->conn->pgconn, new_oid);
else
self->oid = lo_creat(self->conn->pgconn, INV_READ | INV_WRITE);
Dprintf("lobject_open: large object created with oid = %d",
self->oid);