perl and large objects - Mailing list pgsql-interfaces

From Sean Davis
Subject perl and large objects
Date
Msg-id 9ba996673af22c512313dc025914263a@mail.nih.gov
Whole thread Raw
Responses Re: perl and large objects
List pgsql-interfaces
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.

Thanks,
Sean


#!/usr/bin/perl
use strict;
use DBI;

my $dbh = DBI->connect('dbi:Pg:dbname=test2',           undef,           undef,           {AutoCommit=>1},) || die $@;

$dbh->{AutoCommit}=0;
my $lobjID = $dbh->func("./out.png",'lo_import') || die $DBI::errstr;
print $lobjID . "\n";

my $sth=$dbh->prepare('insert into lo_store (obj) values (?)');
$sth->execute($lobjID);
$dbh->commit();

$dbh->func($lobjID,"./lo.pl.copy",'lo_export') || die $@;
$dbh->commit();



pgsql-interfaces by date:

Previous
From: Christoph Haller
Date:
Subject: Re: Network Byte Order Coercion
Next
From: "Daniel Verite"
Date:
Subject: Re: perl and large objects