Actually, the dbdpg and dbi mailing lists are better for this type of
question.  I am CC'ing them.

Once you get an answer, we can adjust the documentation.

---------------------------------------------------------------------------

Jon Salz wrote:
> Hi guys -
> 
> First, things for DBD::Pg!  It's a wonderful tool.  Second, forgive me if
> I'm sending this to any of the wrong people.  (If there's a mailing list I
> should be sending this to, please let me know.)
> 
> I think the DBD::Pg manpage has an incorrect description for lo_export.  
> It reads:
> 
>   $ret = $dbh->func($lobjId, 'lo_export', 'filename');
> 
> It should read (I think):
> 
>   $ret = $dbh->func($lobjId, 'filename', 'lo_export');
> 
> or even better:
> 
>   $ret = $dbh->func($lobjId, $filename, 'lo_export');
> 
> But I can't get lo_export to work!  The following code:
> 
>   use DBI;
> 
>   my $dbh = DBI->connect("dbi:Pg:dbname=transam") or die $!;
>   $dbh->func(18237, "/tmp/out", "lo_export") or die $dbh->errstr;
>   $dbh->disconnect;
> 
> causes a death (w/o error message) in the "lo_export" line.  No /tmp/out 
> is generated.  strace -f tells me that the script is receiving the 
> following on the Pg socket:
> 
>   recv(3, "EERROR:  lo_lseek: invalid large obj descriptor (0)\n\0Z", 
>        16384, 0) = 54
> 
> 18237 is definitely a valid large object descriptor (\lo_export works just 
> fine with it in the psql command-line tool).  Perhaps the descriptor 
> isn't getting properly transmitted?
> 
> The same error occurs when I use
> 
>   $dbh->func(18237, $dbh->{pg_INV_READ}, "lo_open") or die $dbh->errstr;
> 
> Any idea what's up?  I'm using DBI 1.34, DBD::Pg 1.21, Postgres 7.3.2, 
> Perl 5.8.0, RedHat 8.  Thanks in advance!
> 
> - Jon
> 
> -- 
> ----------------------------------------------------------------------
> Jon Salz <jsalz at mit dot edu>                      http://jsalz.net/
> 
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  [EMAIL PROTECTED]               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Reply via email to