From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Laura Smith <n5d9xq3ti233xiyif2vp@protonmail.ch>
To: postgre <pgsql-general@lists.postgresql.org>
Subject: Re: "INSERT ON CONFLICT UPDATE" - Use of indexes ?
Date: Mon, 8 Jun 2020 06:14:42 -0700
Message-ID: <dfdae51f-2c73-394a-a69a-cf18899c2b51@aklaver.com> (raw)
In-Reply-To: <D7XeBgJlPCvQJTomQlRtQ9xXe12qS4v-wYACle-TpfLfsbsdCWd_7SXqFOPJdpiW444JlClvQkREVxJyUA_Avy6BCASy7sDxDOshXw6a8Es=@protonmail.ch>
References: <D7XeBgJlPCvQJTomQlRtQ9xXe12qS4v-wYACle-TpfLfsbsdCWd_7SXqFOPJdpiW444JlClvQkREVxJyUA_Avy6BCASy7sDxDOshXw6a8Es=@protonmail.ch>
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.klaver@aklaver.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, n5d9xq3ti233xiyif2vp@protonmail.ch
Subject: Re: "INSERT ON CONFLICT UPDATE" - Use of indexes ?
In-Reply-To: <dfdae51f-2c73-394a-a69a-cf18899c2b51@aklaver.com>
References: <D7XeBgJlPCvQJTomQlRtQ9xXe12qS4v-wYACle-TpfLfsbsdCWd_7SXqFOPJdpiW444JlClvQkREVxJyUA_Avy6BCASy7sDxDOshXw6a8Es=@protonmail.ch> <dfdae51f-2c73-394a-a69a-cf18899c2b51@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox