- publishing free software manuals
The PostgreSQL 9.0 Reference Manual - Volume 2 - Programming Guide
by The PostgreSQL Global Development Group
Paperback (6"x9"), 478 pages
ISBN 9781906966065
RRP £14.95 ($19.95)

Sales of this book support the PostgreSQL project! Get a printed copy>>>

2.3.9 Truncating a Large Object

To truncate a large object to a given length, call

int lo_truncate(PGcon *conn, int fd, size_t len);

truncates the large object descriptor fd to length len. The fd argument must have been returned by a previous lo_open. If len is greater than the current large object length, the large object is extended with null bytes ('\0').

The file offset is not changed.

On success lo_truncate returns zero. On error, the return value is negative.

lo_truncate is new as of PostgreSQL 8.3; if this function is run against an older server version, it will fail and return a negative value.

ISBN 9781906966065The PostgreSQL 9.0 Reference Manual - Volume 2 - Programming GuideSee the print edition