Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: [EXT]Re: Error with DBD::Pg

6 views
Skip to first unread message

Mark Lawrence via dbi-users

unread,
Nov 1, 2023, 8:15:05 PM11/1/23
to Johnson, Bruce E - (bjohnson), dbi-...@perl.org
On Mon Oct 30, 2023 at 11:21:42PM +0000, Johnson, Bruce E - (bjohnson) wrote:
>
> DBI 1.643-ithread default trace level set to 0x0/3 (pid 101338 pi 5613a02b73e0) at DBI.pm line 294 via startup.pl line 5
>
> -- DBI::END ($@: , $!: )
>
> DBI 1.643-ithread default trace level set to 0x0/3 (pid 101338 pi 5613a036a1c0) at DBI.pm line 294 via startup.pl line 5
>
> -> DBI->connect(dbi:Pg:host=dhbpostgres.pharmacy.arizona.edu;port=5432, calendar3, ****, HASH(0x5613a025f628))
>
> -> DBI->install_driver(Pg) for linux perl=5.032001 pid=101341 ruid=48 euid=48

In my version of DBI this shows the following when tracing (connecting
to SQLite) at level ALL:

DBI 1.643-ithread default trace level set to 0x0/15 (pid 17307 pi 8000004d0) at -e line 1
-> DBI->connect(dbi:SQLite:x, , ****)
-> DBI->install_driver(SQLite) for cygwin perl=5.030003 pid=17307 ruid=197609 euid=197609
install_driver: DBD::SQLite version 1.71_06 loaded from /usr/local/lib/perl5/site_perl/5.30/x86_64-cygwin-threads/DBD/SQLite.pm

That last line is what I would be trying to activate and compare in
your environments: the version and location of the DBD::Pg driver.

--
Mark Lawrence

Mark Lawrence via dbi-users

unread,
Nov 1, 2023, 8:15:05 PM11/1/23
to Johnson, Bruce E - (bjohnson), dbi-...@perl.org
Sorry that I keep dripping this out. My mail reader doesn't parse your
html emails well and I haven't been reading them thoroughly.

You trace output also included this:

install_driver: DBD::Pg version undef loaded from
/usr/lib64/perl5/vendor_perl/Bundle/DBD/Pg.pm

Is that the expected / same location on both hosts? That the version is
'undef' is a bit surprising. And that we don't see the load/install
debug line to begin with.

--
Mark Lawrence

Mark Lawrence via dbi-users

unread,
Nov 1, 2023, 8:15:06 PM11/1/23
to Johnson, Bruce E - (bjohnson), dbi-...@perl.org
[Adding the mailing list back in]

>>You might try turning on DBI_TRACE which will tell you *which*
>>DBD/Pg.pm driver file and version it thinks it successfully loaded.
>
>I added the requisite lines to httpd.conf as per here
>https://perl.apache.org/docs/1.0/guide/databases.html#Debugging_code_which_deploys_DBI

I'm not much help on the Apache or mod_perl side... sorry.

>And got this after restarting httpd (which runs the startup.pl file):
>
>
> DBI 1.643-ithread default trace level set to 0x0/3 (pid 101338 pi 5613a02b73e0) at DBI.pm line 294 via startup.pl line 5

The code in DBI.pm I was looking at needs the 0xF (15?) trace bit to be set.

If you can modify your code I would suggest trying to limiting the
trace to just the connect statement:

DBI->trace(0xF, '/tmp/logfile.txt');
my $lda = DBI->connect("dbi:Pg:$dbname", $login, $dbpass, {RaiseError=>1});
DBI->trace(0, undef);

Or perhaps even the value 'ALL' for that short amount of time:

DBI->trace('ALL', '/tmp/logfile.txt');
my $lda = DBI->connect("dbi:Pg:$dbname", $login, $dbpass, {RaiseError=>1});
DBI->trace(0, undef);

You can use DBI_TRACE=ALL=/tmp/logfile.txt as well.

--
Mark Lawrence
0 new messages