Class: PGlarge

Class | PGlarge
In: | postgres.c
Parent: | Object

The class to access large objects. An instance of this class is created as the result of PGconn#lo_import, PGconn#lo_create, and PGconn#lo_open.

### Methods

close export oid open read seek size tell unlink write

### Constants

INV_WRITE | = | INT2FIX(INV_WRITE)
INV_READ | = | INT2FIX(INV_READ)
SEEK_SET | = | INT2FIX(SEEK_SET)
SEEK_CUR | = | INT2FIX(SEEK_CUR)
SEEK_END | = | INT2FIX(SEEK_END)

### Public Instance methods

lrg.close()

Closes a large object. Closed when they are garbage-collected.

lrg.export( file )

Saves the large object to a file.

lrg.oid()

Returns the large object‘s `oid`.

lrg.open( [mode] )

Opens a large object. The mode argument specifies the mode for the opened large object, which is either `INV_READ` or `INV_WRITE`.

lrg.read( [length] )

Attempts to read length bytes from large object. If no length is given, reads all data.

lrg.seek( offset, whence )

Move the large object pointer to the offset. Valid values for whence are `SEEK_SET`, `SEEK_CUR`, and `SEEK_END`. (Or 0, 1, or 2.)

lrg.size()

Returns the size of the large object.

lrg.tell()

Returns the current position of the large object pointer.

lrg.unlink()

Deletes the large object.

lrg.write( str )

Writes the string str to the large object. Returns the number of bytes written.

[Validate]