pg_lo_truncate — Truncate a large object, changing its size


pg_lo_truncate conn descriptor length


pg_lo_truncate changes the size of a large object to a specified number of bytes. If the new size is smaller than the current size, the large object is truncated. If the new size is larger than the current size, the large object is padded with null bytes.



The handle of the connection.


A descriptor for the large object from pg_lo_open.


The desired new size in bytes for the large object.

Return Value

Nothing. A Tcl error will be thrown if an error occurs.


All large object manipulation must take place within an SQL transaction block.

This function is limited to using a 32-bit signed length (about 2GB). See pg_lo_truncate64 for 64-bit length support.

This command was added in pgtclng-1.7.0 and in pgintcl-3.1.0.

This command uses or emulates the PostgreSQL libpq function lo_truncate. That function was added to libpq and the PostgreSQL server in version 8.3, and the command will not be available if using older versions. Logo

This version of the manual was produced for the Pgtcl-ng Sourceforge project web service site, which requires the logo on each page.

To download a logo-free copy of the manual, see the Pgtcl-ng project downloads area.