X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id C008FD1C9BA for ; Sat, 21 Feb 2004 17:11:53 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 91594-02 for ; Sat, 21 Feb 2004 13:11:48 -0400 (AST) Received: from granger.mail.mindspring.net (granger.mail.mindspring.net [207.69.200.148]) by svr1.postgresql.org (Postfix) with ESMTP id 5F330D1B4C5 for ; Sat, 21 Feb 2004 13:11:47 -0400 (AST) Received: from sdn-ap-007njpennp0108.dialsprint.net ([63.185.192.108] helo=mindspring.com) by granger.mail.mindspring.net with esmtp (Exim 3.33 #1) id 1AuafJ-0002Yj-00; Sat, 21 Feb 2004 12:11:45 -0500 Received: (from lbayuk@localhost) by mindspring.com (8.12.10/8.12.10) id i1LGpFpL000747; Sat, 21 Feb 2004 11:51:15 -0500 From: L J Bayuk Message-Id: <200402211651.i1LGpFpL000747@mindspring.com> Subject: Re: create large object by tcl To: hehe88hk@yahoo.com.hk (Eric) Date: Sat, 21 Feb 2004 11:51:15 -0500 (EST) Cc: pgsql-interfaces@postgresql.org In-Reply-To: from "Eric" at Feb 20, 2004 02:24:22 AM X-Mailer: ELM [version 2.5 PL6] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/70 X-Sequence-Number: 4763 hehe88hk@yahoo.com.hk wrote: > ... > If I use the libpgtcl library, I find it can only get a file > descriptor of '-1' returned by pg_lo_open. > > If I use pgintcl, I find it can only get a file descriptor of '0' > returned by pg_lo_open, followed by an error message: > > " > ERROR: lo_write: invalid large obj descriptor (0) > ... Are you doing all your large object calls inside transaction blocks, as required? If not, the large object descriptors will not be valid. Send BEGIN, operate on a large object, then send COMMIT.