Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Capturing warnings from DBD:PG

by RichardK (Parson)
on Nov 15, 2015 at 05: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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2018-09-26 00:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Eventually, "covfefe" will come to mean:













    Results (205 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 18:53 UTC) Welcome new users!