-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I'm having some problems with lo_open inside of DBD::Pg (which
uses libpq) and need help in debugging the problem. The problem
is that a call to lo_open works perfectly, *unless* it is the
first thing that this connection to the database has done, in
which case it returns a -1 (which comes back to perl as undef).
To be more specific, I need to issue a "SELECT 123;" (or anything
else via PQexec) before the call will succeeed. All the parameters
to lo_open look normal and identical whether PQexec has been called
or not, and lo_creat always works just fine. It has to be PQexec*,
a prepare alone will not do the trick.
Here is a small sample code in Perl that demonstrates:
#!perl
use DBI; use strict; use warnings;
my $dbh = DBI->connect($ENV{DBI_DSN}, $ENV{DBI_USER}, '', {AutoCommit=>0, RaiseError=>1});
# If the below line is commented out, this test will fail:
$dbh->do("SELECT 123");
my $W = $dbh->{pg_INV_WRITE};
my $object = $dbh->func($W, 'lo_creat');
my $handle = $dbh->func($object, $W, 'lo_open');
printf "This test %s!\n", defined $handle ? "worked" : "did not work";
$dbh->disconnect;
Thanks,
- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200505121009
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----
iD8DBQFCg2nKvJuQZxSWSsgRAoqxAJ4+jdYo+BrxHb0smXzU2FzOzPODHwCg/hZB
oHcq8t479a5OKaURCl8Kl5U=
=rmbL
-----END PGP SIGNATURE-----