Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: Capturing warnings from DBD:PG

by RichardK (Parson)
on Nov 15, 2015 at 10:52 UTC ( #1147722=note: print w/replies, xml ) Need Help??

in reply to Capturing warnings from DBD:PG

Are you sure that you're checking error message of the right call?

The DBI docs say this :-

$str = $h->errstr; Returns the native database engine error message from the last DBI + method called. ... and $DBI::err Equivalent to "$h->err". $DBI::errstr Equivalent to "$h->errstr". $DBI::state Equivalent to "$h->state".

So didn't you just check if the last_insert_id call succeeded?

You need to check the err and maybe the state after the execute. So at least something like

$rv = $sth->execute or die $sth->errstr;

BTW it's probably worth asking this question on the posrgresql mailing list or IRC, as they'll know the best way to do this and it's more of a DB problem than a perl one.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1147722]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2020-05-26 12:44 GMT
Find Nodes?
    Voting Booth?
    If programming languages were movie genres, Perl would be:

    Results (150 votes). Check out past polls.