Re: BUG #13917: "upsert" construct doesn't work with partial index

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: dv(at)unlimitedsoftware(dot)it
Cc: pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #13917: "upsert" construct doesn't work with partial index
Date: 2016-02-09 01:32:52
Message-ID: CAM3SWZTvWV+jANWY1qE-f9vyqJw6_M0cgcHhBrAueAU5H6MmVQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Feb 4, 2016 at 8:31 AM, <dv(at)unlimitedsoftware(dot)it> wrote:
> an INSERT ... ON CONFLICT DO NOTHING statement doesn't twork if unique index
> on duplicated field is created without "where" clause. In case of co called
> "partial index" the duplicate key exception rises.

Please provide a concrete test case. I think you just need to spell
out the WHERE clause in the inference specification. That will use
both indexes (the partial unique index, as well as the non-partial
unique index on the same fields).

--
Peter Geoghegan

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Geoghegan 2016-02-09 01:45:55 Re: BUG #13936: jsonb_object() -> ERROR: unknown type of jsonb container
Previous Message Michael Paquier 2016-02-09 00:07:34 Re: Re: BUG #13685: Archiving while idle every archive_timeout with wal_level hot_standby