Re: postgres insert

2006-11-25 Thread Tom Allison
D. Bolliger wrote: Tom Allison am Donnerstag, 23. November 2006 16:13: [snipped some code] I get a STDERR warning printed out everytime this has a duplicate key violation... Any idea why eval{} doesn't suppress this? Hi Tom It'd be a bad idea... eval BLOCK adds the ability to catch runtime

Re: postgres insert

2006-11-23 Thread D. Bolliger
Tom Allison am Donnerstag, 23. November 2006 16:13: [snipped some code] > I get a STDERR warning printed out everytime this has a duplicate key > violation... > > Any idea why eval{} doesn't suppress this? Hi Tom It'd be a bad idea... eval BLOCK adds the ability to catch runtime errors and modi

postgres insert

2006-11-23 Thread Tom Allison
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/;