perl and large objects

From: Sean Davis <sdavis2(at)mail(dot)nih(dot)gov>
To: pgsql-interfaces <pgsql-interfaces(at)postgresql(dot)org>
Subject: perl and large objects
Date: 2005-05-18 22:36:50
Message-ID: 9ba996673af22c512313dc025914263a@mail.nih.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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();

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Daniel Verite 2005-05-18 23:07:27 Re: perl and large objects
Previous Message Christoph Haller 2005-05-18 11:09:42 Re: Network Byte Order Coercion