Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1msVfF-00073q-AJ for pgsql-general@arkaria.postgresql.org; Wed, 01 Dec 2021 19:53:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1msVfE-0005QZ-0N for pgsql-general@arkaria.postgresql.org; Wed, 01 Dec 2021 19:53:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1msVfD-0005QQ-Lt for pgsql-general@lists.postgresql.org; Wed, 01 Dec 2021 19:53:11 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1msVfB-0004qz-E4 for pgsql-general@lists.postgresql.org; Wed, 01 Dec 2021 19:53:10 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 1B1Jqw1E1990142; Wed, 1 Dec 2021 14:52:58 -0500 From: Tom Lane To: "David G. Johnston" cc: Jenda Krynicky , "pgsql-generallists.postgresql.org" Subject: Re: INSERT ... ON CONFLICT doesn't work In-reply-to: References: <61A7CB18.20091.3401B246@Jenda.Krynicky.cz> Comments: In-reply-to "David G. Johnston" message dated "Wed, 01 Dec 2021 12:35:37 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1990140.1638388378.1@sss.pgh.pa.us> Date: Wed, 01 Dec 2021 14:52:58 -0500 Message-ID: <1990141.1638388378@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > On Wed, Dec 1, 2021 at 12:21 PM Jenda Krynicky wrote: >> THERE IS NO (CENSORED) VARIABLE "Uuid"! > Yes, there is. RETURNS TABLE (... "Uuid" text ... ) > Changing that to something else should remove the ambiguity. I agree it is > not an ideal solution though. I'm not sure what other options exist though. The variable_conflict options that Adrian pointed to are one way out. It's also possible to qualify the name in the ON CONFLICT clause, although I think you have to parenthesize it to do so: ... ON CONFLICT (("Lockers"."Uuid")) regards, tom lane