Method Description
PgsqlConnection.openLargeObject()
Open an existing Postgres Large Object for reading or writing
See Also
PgsqlConnection,
PgsqlResult,
Binary
Syntax
Binary = PgsqlConnection.openLargeObject(OID, mode)
Parameters
The 'PgsqlConnection.openLargeObject' method takes 2 parameters:
Name | Type/Value | Range/Length | Description | OID | number | | Required. The Postgres OID representing the file to be openned | mode | number | | Required. 1=read, 2=write, 3=read/write |
Results
The 'PgsqlConnection.openLargeObject' method returns Binary:
Type/Value | Range/Length | Description |
Binary |
  |
A binary object representing the requested object
|
Remarks Opens an existing Postgres Large Object (LOB) for reading and/or writing. Note that the object must already exist. If the object is successfully openned then the method returns
a specialised binary object. The standard binary object methods (read/write) can be used on the resulting
object. If the object cannot be openned then 'null' is returned to the caller As well as the standard binary object methods and attributes the Binary object created by this call will
have the following attributes: Attribute | Description |
---|
sizeof | The actual size of the existing Large Object when openned. Note that this does not change as you write to the object. It is the size when openned. | oid | The Postgres OID for the open object (more useful when the new LO has just been created). |
In addition to the attributes above, the 'load()' method is over-ridden. For an open Large Object invoking the 'load' method loads the entire contents
of the Large Object into memory into the Binary object. Note that in this case 'load' takes no parameters. Note that the large object is only valid until the database is closed, or the next call to 'connection.exec' is made. |