postgres insert
I've been using something like this for Oracle for some time
and tried it with Postgresql.
(RaiseError doesn't change the outcome)
sub insert_token {
my $token = shift;
eval{ $sth1->execute($token) };
if ($@) {
return 1 if $@ =~ /duplicate key violates unique constraint/;
die "ERROR: $@\n";
}
return $sth1->rows;
}
I get a STDERR warning printed out everytime this has a duplicate key violation...
Any idea why eval{} doesn't suppress this?
.
Relevant Pages
- Re: postgres insert
... and tried it with Postgresql. ... (RaiseError doesn't change the outcome) ... sub insert_token { ... my $token = shift; ... (perl.beginners) - Re: Need your help [arguments for open source databases]
... >> I would like to have your opinions about open source databases versus ... >> in the universe of relational databases. ... The main difference between PostgreSQL and Oracle is manageability. ... (RedHat) - difficulties with utf-8 characters using DBD::Oracle, where works using DBD::Pg (PostgreSQL)
... I have a cgi application that works fine using DBD::Pg to insert/select data ... I have modified the application to use either Oracle or PostgreSQL, ... EOF ... (perl.dbi.users) - Re: Read from database, write to another database, simultaneously
... If you can get Oracle to dump the data in the form of SQL insert ... PostgreSQL the entire job starts to look something like: ... the DB-API capability. ... if not batch: break ... (comp.lang.python) - Good DBA Book
... I'm sure this question has been asked a hundred times, but after looking into google for a few hours, I have so many books, I really don't know which one is right. ... like Oracle Essentials from O'Reilly. ... With all the step required, and if possible, example code and script, what is involved in a production database. ... The course will explain how to use PostgreSQL, ... (comp.databases.oracle.server) |
|