Re: [GENERAL] discard on constraint violation

2011-06-27 Thread David Johnston
>>My situation is that I'm reading data from an external website with lots of duplicate data. I am reading the data in a plpythonu function. I never update, only insert. A trigger on the table that has to check if each row exists before trying the insert is too much overhead. Create a staging tabl

Re: [GENERAL] discard on constraint violation

2011-06-27 Thread Guillaume Lelarge
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

[GENERAL] discard on constraint violation

2011-06-27 Thread Sim Zacks
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. My situation is that I'm reading data from an external website with lots of duplicate data. I am reading