Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bK6tW-0001UY-R2 for pgsql-bugs@arkaria.postgresql.org; Mon, 04 Jul 2016 16:38:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bK6tW-000327-Dn for pgsql-bugs@arkaria.postgresql.org; Mon, 04 Jul 2016 16:38:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bK6ss-0001cz-Iv for pgsql-bugs@postgresql.org; Mon, 04 Jul 2016 16:38:10 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bK6so-00089t-Fy for pgsql-bugs@postgresql.org; Mon, 04 Jul 2016 16:38:09 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u64Gc1pr001475; Mon, 4 Jul 2016 12:38:01 -0400 From: Tom Lane To: Peter Geoghegan cc: pgsql-bugs@postgresql.org, Miko Kiiski , Heikki Rauhala Subject: Re: "insert [...] on conflict" hangs on conflict on an unmentioned gist index In-reply-to: <19377.1467644433@sss.pgh.pa.us> References: <4C976D6B-76B4-434C-8052-D009F7B7AEDA@reaktor.fi> <19377.1467644433@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Mon, 04 Jul 2016 11:00:33 -0400" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <1442.1467650240.0@sss.pgh.pa.us> Date: Mon, 04 Jul 2016 12:38:01 -0400 Message-ID: <1474.1467650281@sss.pgh.pa.us> X-Pg-Spam-Score: -3.2 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1442.1467650240.1@sss.pgh.pa.us> 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 ------- =_aaaaaaaaaa0 Content-Type: text/x-diff; name="fix-non-arbiter-exclusion-index.patch"; charset="us-ascii" Content-ID: <1442.1467650240.2@sss.pgh.pa.us> Content-Description: fix-non-arbiter-exclusion-index.patch Content-Transfer-Encoding: quoted-printable diff --git a/src/backend/executor/execIndexing.c b/src/backend/executor/exe= cIndexing.c index 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; =20=20 ! if (noDupErr) { violationOK =3D true; waitMode =3D CEOUC_LIVELOCK_PREVENTING_WAIT; --- 407,413 ---- bool violationOK; CEOUC_WAIT_MODE waitMode; =20=20 ! if (noDupErr && (arbiterIndexes =3D=3D NIL || arbiter)) { violationOK =3D true; waitMode =3D CEOUC_LIVELOCK_PREVENTING_WAIT; ------- =_aaaaaaaaaa0 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs ------- =_aaaaaaaaaa0--