Re: "INSERT ON CONFLICT UPDATE" - Use of indexes ?

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Laura Smith <n5d9xq3ti233xiyif2vp(at)protonmail(dot)ch>, postgre <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: "INSERT ON CONFLICT UPDATE" - Use of indexes ?
Date: 2020-06-08 13:14:42
Message-ID: dfdae51f-2c73-394a-a69a-cf18899c2b51@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 6/8/20 5:42 AM, Laura Smith wrote:
> Hi,
>
> What'st the current state of play with indexes and ON CONFLICT ?  The docs seem to vaguely suggest it is possible, but this SO question (https://stackoverflow.com/questions/38945027/) seems to suggest it is not.
>
> I've got a unique named index on a table (i.e. "create unique index xyz...") but I cannot seem to be able to refer to it in a function ?
> ON CONFLICT (index_name) .... : does not work
> ON CONFLICT ON CONSTRAINT index_name....: does not work
>

The above is going to need more information:

1) Table definition.

2) Actual index definition

3) Complete ON CONFLICT definition

4) Error message returned.

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Kellerer 2020-06-08 13:20:32 Re: "INSERT ON CONFLICT UPDATE" - Use of indexes ?
Previous Message Ron 2020-06-08 13:07:04 Re: When to use PARTITION BY HASH?