pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sean Davis <sdavis2@mail.nih.gov>
To: pgsql-interfaces <pgsql-interfaces@postgresql.org>
Subject: perl and large objects
Date: Wed, 18 May 2005 18:36:50 -0400
Message-ID: <9ba996673af22c512313dc025914263a@mail.nih.gov> (raw)

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();




view thread (4+ messages)  latest in thread

Message-ID: <9ba996673af22c512313dc025914263a@mail.nih.gov>
Permalink:  ../9ba996673af22c512313dc025914263a@mail.nih.gov/
Also on:    postgresql.org/message-id/9ba996673af22c512313dc025914263a@mail.nih.gov

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: sdavis2@mail.nih.gov
  Subject: Re: perl and large objects
  In-Reply-To: <9ba996673af22c512313dc025914263a@mail.nih.gov>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox