This pathch will add truncate function to the LargeObject that is supported in PostgreSQL V 8.3 or prev with paches.

In addition attached LargeObject.cs has changes all usages of Array.Copy to Buffer.BlockCopy

Seek function is now returns Int32 that is new position after the operation

Unfortunatly, I can attach only one file in this form, so another related change in LargeObjectManager.cs I am posting here. It has updated constructor wich selects fid for lo_truncate.

/*
* Constructs the LargeObject API.
*
* <p><b>Important Notice</b>
* <br>This method should only be called by org.postgresql.Connection
*
* <p>There should only be one LargeObjectManager per Connection. The
* org.postgresql.Connection class keeps track of the various extension API's
* and it's advised you use those to gain access, and not going direct.
*/
public LargeObjectManager(NpgsqlConnection conn)
{
// We need Fastpath to do anything
// Now get the function oid's for the api
//
// This is an example of Fastpath.addFunctions();
//
String sql;
if (conn.PostgreSqlVersion > new ServerVersion(7, 3, 0))
{