On Sat, Jul 06, 2002 at 12:18:56PM -0300, wrote:
>
> When you are trying to insert a row in a table with a UNIQUE constraint,
> unless it already exists, you can try something like:
>
> INSERT INTO table (id) SELECT val WHERE NOT EXISTS (SELECT 1 FROM table WHERE id =
>val)
>
> However, this
When you are trying to insert a row in a table with a UNIQUE constraint,
unless it already exists, you can try something like:
INSERT INTO table (id) SELECT val WHERE NOT EXISTS (SELECT 1 FROM table WHERE id = val)
However, this does not work as expected if another backend inserts a row
with th