pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Kellerer <shammat@gmx.net>
To: pgsql-general@lists.postgresql.org
Subject: Re: "INSERT ON CONFLICT UPDATE" - Use of indexes ?
Date: Mon, 8 Jun 2020 15:20:32 +0200
Message-ID: <06a075d8-68d2-601b-d312-db1d7f6db4f5@gmx.net> (raw)
In-Reply-To: <D7XeBgJlPCvQJTomQlRtQ9xXe12qS4v-wYACle-TpfLfsbsdCWd_7SXqFOPJdpiW444JlClvQkREVxJyUA_Avy6BCASy7sDxDOshXw6a8Es=@protonmail.ch>
References: <D7XeBgJlPCvQJTomQlRtQ9xXe12qS4v-wYACle-TpfLfsbsdCWd_7SXqFOPJdpiW444JlClvQkREVxJyUA_Avy6BCASy7sDxDOshXw6a8Es=@protonmail.ch>

Laura Smith schrieb am 08.06.2020 um 14:42:
> 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

If c1 and c2 make up a unique index, then

    ON CONFLICT (c1, c2)

works







view thread (4+ messages)  latest in thread

Message-ID: <06a075d8-68d2-601b-d312-db1d7f6db4f5@gmx.net>
Permalink:  ../06a075d8-68d2-601b-d312-db1d7f6db4f5@gmx.net/
Also on:    postgresql.org/message-id/06a075d8-68d2-601b-d312-db1d7f6db4f5@gmx.net

 · 

reply

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: shammat@gmx.net
  Subject: Re: "INSERT ON CONFLICT UPDATE" - Use of indexes ?
  In-Reply-To: <06a075d8-68d2-601b-d312-db1d7f6db4f5@gmx.net>
  References: <D7XeBgJlPCvQJTomQlRtQ9xXe12qS4v-wYACle-TpfLfsbsdCWd_7SXqFOPJdpiW444JlClvQkREVxJyUA_Avy6BCASy7sDxDOshXw6a8Es=@protonmail.ch> <06a075d8-68d2-601b-d312-db1d7f6db4f5@gmx.net>

* 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