X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 0BCA952888 for ; Thu, 19 May 2005 07:05:37 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 77444-04 for ; Thu, 19 May 2005 10:05:33 +0000 (GMT) Received: from mx5.net.nih.gov (mailfwd.nih.gov [165.112.130.36]) by svr1.postgresql.org (Postfix) with ESMTP id 5CE7D5288E for ; Thu, 19 May 2005 07:05:32 -0300 (ADT) Received: from mx5.net.nih.gov (localhost [127.0.0.1]) by mx5.net.nih.gov (8.12.10/8.11.6) with ESMTP id j4JA5bas027654 for ; Thu, 19 May 2005 06:05:38 -0400 Received: from [128.231.145.14] (holmes.nhgri.nih.gov [128.231.145.14]) by mx5.net.nih.gov (8.12.10/8.11.6) with ESMTP id j4JA5bKd027651; Thu, 19 May 2005 06:05:37 -0400 In-Reply-To: <20050519010331.7693010@localhost> References: <20050519010331.7693010@localhost> Mime-Version: 1.0 (Apple Message framework v622) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <4dc77e1fc370855bf943a592b665e88c@mail.nih.gov> Content-Transfer-Encoding: 7bit Cc: "pgsql-interfaces" From: Sean Davis Subject: Re: perl and large objects Date: Thu, 19 May 2005 06:05:36 -0400 To: "Daniel Verite" X-Mailer: Apple Mail (2.622) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.004 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200505/41 X-Sequence-Number: 5544 On May 18, 2005, at 7:07 PM, Daniel Verite wrote: > Sean Davis wrote: > >> I am new to large objects and have a simple test script that dies (at >> the lo_import line) and I don't know why (no descriptive error given). >> Any suggestions (or a quick tutorial)? The DBD manual just wasn't >> quite enough for me, I guess. > > The lack of error message feels like what happens when you call lo_* > functions outside of a transaction. IIRC you just get 0 as the > resulting > oid to a lo_import, for instance. > > You could try adding $dbh->do("select 1") just after > $dbh->{AutoCommit}=0 > to ensure that a transaction is started before the lo_import. > > Also, your code snippet runs fine for me, unmodified, with DBD::Pg 1.21 > Are you running an older version? > DBD::Pg-1.41 It was indeed that the transaction was not started. Putting in a couple of "select 1" worked just fine. Thanks for the help. Sean