Re: discard on constraint violation

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Sim Zacks <sim(at)compulab(dot)co(dot)il>
Cc: PostgreSQL general <pgsql-general(at)postgresql(dot)org>
Subject: Re: discard on constraint violation
Date: 2011-06-27 12:57:23
Message-ID: 1309179443.14751.15.camel@laptop
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 2011-06-27 at 15:36 +0300, Sim Zacks wrote:
> Is there a way to tell a table to discard an insert if it violates a
> constraint (unique in my case) instead of giving an error? I don't want
> the overhead of a trigger on each row inserted.
>

Without a trigger, you can't.

--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Radoslaw Smogura 2011-06-27 14:02:22 Re: Reusing cached prepared statement slow after 5 executions
Previous Message Vincent Veyron 2011-06-27 12:48:20 Re: An amusing MySQL weakness--not!