Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2018-07-20 16:44 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (438 votes). Check out past polls.