From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Geoghegan <pg@heroku.com>
Cc: pgsql-bugs@postgresql.org, Miko Kiiski <miko.kiiski@reaktor.com>
Cc: Heikki Rauhala <heikki.rauhala@reaktor.fi>
Subject: Re: "insert [...] on conflict" hangs on conflict on an unmentioned gist index
Date: Mon, 04 Jul 2016 12:38:01 -0400
Message-ID: <1474.1467650281@sss.pgh.pa.us> (raw)
In-Reply-To: <19377.1467644433@sss.pgh.pa.us>
References: <4C976D6B-76B4-434C-8052-D009F7B7AEDA@reaktor.fi>
<19377.1467644433@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
I wrote:
> It looks to me like the ON CONFLICT code has exactly zero chance of
> working with non-btree (or more generally, non-amcanunique) indexes.
Nah, I take that back --- I was expecting this to be handled somewhere
else than it is. It looks like the actual cause is just sloppy
handling of noDupErr in ExecInsertIndexTuples; the attached fixes it
for me.
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugsAttachments:fix-non-arbiter-exclusion-index.patch (text/x-diff, 647B) downloaddiff --git a/src/backend/executor/execIndexing.c b/src/backend/executor/execIndexing.cindex c819d19..e73bad3 100644
*** a/src/backend/executor/execIndexing.c
--- b/src/backend/executor/execIndexing.c
*************** ExecInsertIndexTuples(TupleTableSlot *sl
*** 407,413 ****
bool violationOK;
CEOUC_WAIT_MODE waitMode;
! if (noDupErr)
{
violationOK = true;
waitMode = CEOUC_LIVELOCK_PREVENTING_WAIT;
--- 407,413 ----
bool violationOK;
CEOUC_WAIT_MODE waitMode;
! if (noDupErr && (arbiterIndexes == NIL || arbiter))
{
violationOK = true;
waitMode = CEOUC_LIVELOCK_PREVENTING_WAIT;
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-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, pg@heroku.com, miko.kiiski@reaktor.com, heikki.rauhala@reaktor.fi
Subject: Re: "insert [...] on conflict" hangs on conflict on an unmentioned gist index
In-Reply-To: <1474.1467650281@sss.pgh.pa.us>
References: <4C976D6B-76B4-434C-8052-D009F7B7AEDA@reaktor.fi> <19377.1467644433@sss.pgh.pa.us> <1474.1467650281@sss.pgh.pa.us>
* 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