trigger insert duplicate rows question - Mailing list pgsql-general

From T.R.Missner@Level3.com
Subject trigger insert duplicate rows question
Date
Msg-id EBFCF3982143D511A77F0008C716807E0106DB30@N0400IDC1.oss.level3.com
Whole thread Raw
Responses Re: trigger insert duplicate rows question
List pgsql-general
I have designed a trigger that will insert a row
in a table if a check to see if the row is already there fails.
Everything works as expected when running slow or with few threads.
but when I kick up the threads that handle the initial insert that
'triggers' the trigger I run into some trouble.  It seems that
in some cases after the trigger function has done a selct to see it
the data already exist then moves on to the insert the insert fails
because another thread has already finished inserting the same row.
I get an error about duplicate rows etc.

This in itself is really not a problem.  What I would like to do
is suppress the error message somehow.  I am using jdbc on the client side
and can't figure out how to suppress the error from going to stdout.

Can I capture it in the procedure code?

Any other suggestions?

Is there a way to get a return from the insert statement in the prodecure?

thanks in advance.
t.r. missner

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Where are Perl DBI and DBD for PostgreSQL??
Next
From: Martijn van Oosterhout
Date:
Subject: Re: WHERE CLAUSE