Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b0VCf-0005Uj-H4 for pgsql-bugs@arkaria.postgresql.org; Wed, 11 May 2016 14:33:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1b0VCf-00084g-3u for pgsql-bugs@arkaria.postgresql.org; Wed, 11 May 2016 14:33:33 +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 1b0VCe-00081r-Af for pgsql-bugs@postgresql.org; Wed, 11 May 2016 14:33:32 +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 1b0VCa-00015t-GY for pgsql-bugs@postgresql.org; Wed, 11 May 2016 14:33:31 +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 u4BEXP0n015187; Wed, 11 May 2016 10:33:25 -0400 From: Tom Lane To: fiercetuba@protonmail.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #14132: ON CONFLICT not inferring unique index with bigints In-reply-to: <20160510190350.2608.48667@wrigleys.postgresql.org> References: <20160510190350.2608.48667@wrigleys.postgresql.org> Comments: In-reply-to fiercetuba@protonmail.com message dated "Tue, 10 May 2016 19:03:50 -0000" Date: Wed, 11 May 2016 10:33:25 -0400 Message-ID: <15186.1462977205@sss.pgh.pa.us> X-Pg-Spam-Score: -3.3 (---) 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 fiercetuba@protonmail.com writes: > This fails, but change bigint to int and it works fine. Looks like somebody forgot to run the ON CONFLICT list through expression preprocessing. Unfortunately it's too late to get this fixed in tomorrow's releases :-( As a workaround for this particular example, you could write either INSERT INTO testtable(b, c) VALUES (1, 2) ON CONFLICT ((COALESCE(b, '0'::int8)), (COALESCE(c, '0'::int8))) DO NOTHING; INSERT INTO testtable(b, c) VALUES (1, 2) ON CONFLICT ((COALESCE(b, '0')), (COALESCE(c, '0'))) DO NOTHING; but in general there might not be any such easy solution. 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-bugs