Re: [GENERAL] Upsert with a partial unique index constraint violation

2016-07-14 Thread Tim Dawborn
Awesome. Thanks, Tom. Glad to see this issue has been patched upstream. I'll use the alternative syntax in the meantime. Cheers, Tim On 13 July 2016 at 01:03, Tom Lane wrote: > Peter Geoghegan writes: > > On Mon, Jul 11, 2016 at 12:06 AM, Tim Dawborn > wrote: > >> tmp=# INSERT INTO foo (a, b

Re: [GENERAL] Upsert with a partial unique index constraint violation

2016-07-12 Thread Tim Dawborn
Correct, there was no typo there. All of the psql examples I included were copy-pasted out of a clean psql 9.5 session on a clean psql 9.5 database (64 bit linux). $ createdb tmp $ psql --quiet tmp tmp=# select version(); version ---

Re: [GENERAL] Upsert with a partial unique index constraint violation

2016-07-12 Thread Tom Lane
Peter Geoghegan writes: > On Mon, Jul 11, 2016 at 12:06 AM, Tim Dawborn wrote: >> tmp=# INSERT INTO foo (a, b, c, d) VALUES (1, 2, 'four', true) >> tmp-# ON CONFLICT (a, b) WHERE d = true >> tmp-# DO UPDATE SET c = 'four' WHERE foo.a = 1 AND foo.b = 2 AND foo.d = >> true; >> ERROR: there is no u

Re: [GENERAL] Upsert with a partial unique index constraint violation

2016-07-11 Thread Peter Geoghegan
On Mon, Jul 11, 2016 at 12:06 AM, Tim Dawborn wrote: > tmp=# INSERT INTO foo (a, b, c, d) VALUES (1, 2, 'four', true) > tmp-# ON CONFLICT (a, b) WHERE d = true > tmp-# DO UPDATE SET c = 'four' WHERE foo.a = 1 AND foo.b = 2 AND foo.d = > true; > ERROR: there is no unique or exclusion constraint ma