Re: [GENERAL] INSERT and ON CONFLICT

2017-03-10 Thread Rich Shepard
On Fri, 10 Mar 2017, Brian Dunavant wrote: I believe the following test should answer your question. Thank you, Brian. It does answer my question. Regards, Rich -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgres

Re: [GENERAL] INSERT and ON CONFLICT

2017-03-10 Thread Brian Dunavant
I believe the following test should answer your question. db=# create table test ( a integer not null unique ); CREATE TABLE db=# insert into test values (1); INSERT 0 1 db=# insert into test values (1); ERROR: duplicate key value violates unique constraint "test_a_key" DETAIL: Key (a)=(1) alr

[GENERAL] INSERT and ON CONFLICT

2017-03-10 Thread Rich Shepard
I'm filling a table with rows and have the first batch successfully inserted. When I add more rows there may be some that already exist in the table and I would prefer that they be ignored and the insert process continue. The syntax page for INSERT suggests that ON CONFLICT DO NOTHING is exac