Thread: Problem with Large Objects

Problem with Large Objects

From
Dorin Grunberg
Date:
I am trying to recreate the example from the Postgresql manual using Perl 
and DBI.

I was able to insert the image 'inside' the table. I checked the /tmp 
directory to see if it is there.

When I run the following lines I get the output an "1"


my $sth = $dbh->prepare_cached(qq{SELECT lo_export(image.file, 
'/tmp/Patti.jpg') from image WHERE name='picture'}) || die "Can't prepare 
statement: $DBI::errstr";

my $rc = $sth->execute || die "Can't execute statement: 
$DBI::errstr";
                while (($picture) = $sth->fetchrow_array() ) {                    print $picture;
                }

What am I doing wrong here?