Skip Menu |

This queue is for tickets about the DBD-Pg CPAN distribution.

Report information
The Basics
Id: 120268
Status: resolved
Priority: 0/
Queue: DBD-Pg

Owner: greg [...]
Requestors: caseyandgina [...]

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)

Subject: Support DBI's PrintErrorStatement = 1
Date: Wed, 15 Feb 2017 14:23:39 -0800
To: bug-DBD-Pg [...]
From: Casey & Gina Shobe <caseyandgina [...]>
Download (untitled) / with headers
text/plain 729b
As shown below, DBD::Pg does not currently honor DBI's PrintErrorStatement = 1 setting: $ cat test #!/usr/local/bin/perl use strict; use warnings; use English; use DBI; my $database = DBI->connect ( 'dbi:Pg:host=localhost;port=5432;dbname=management', 'app_database_management', 'password', { AutoCommit => 0, RaiseError => 1, PrintError => 0, ShowErrorStatement => 1 } ); $database->do ('select 1 + 3 from asrocidasoercid'); $ ./test DBD::Pg::db do failed: ERROR: relation "asrocidasoercid" does not exist LINE 4: asrocidasoercid ^ at ./test line 19. Issuing rollback() due to DESTROY without explicit disconnect() of DBD::Pg::db handle host=localhost;port=5432;dbname=management at ./test line 19.
Download (untitled) / with headers
text/plain 699b
On Wed Feb 15 18:23:58 2017, wrote: Show quoted text
> As shown below, DBD::Pg does not currently honor DBI's > PrintErrorStatement = 1 setting:
(I think you mean ShowErrorStatement). DBD::Pg does honor it, but do() without any arguments uses a "quick path" optimization which does not use the underlying prepare/execute code, which ShowErrorStatement relies upon to grab the statement. I'm not sure if there is a way to make it work easily, so I will leave this open. You should be able to confirm ShowErrorStatement works in other cases like this: $dbh->{ShowErrorStatement} = 1; $dbh->do("SELECT ?::invalid", undef, 123); ## AND: $sth = $dbh->prepare("invalid"); $sth->execute();
Download (untitled) / with headers
text/plain 143b
I cannot see a way to make this work, so I added a documentation note in b1e78f723ed2ceda1616157b2ca808637e2da3bf and will close this ticket.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to