Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gT3WF-0007F3-GS for pgsql-bugs@arkaria.postgresql.org; Sat, 01 Dec 2018 11:33:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gT3VG-0001aC-9i for pgsql-bugs@arkaria.postgresql.org; Sat, 01 Dec 2018 11:32:06 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gT3VF-0001a5-WE for pgsql-bugs@lists.postgresql.org; Sat, 01 Dec 2018 11:32:06 +0000 Received: from lungold.riddles.org.uk ([82.68.208.19]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gT3VC-0002qK-VN for pgsql-bugs@lists.postgresql.org; Sat, 01 Dec 2018 11:32:04 +0000 Received: from [192.168.127.1] (port=65220 helo=caithnard.riddles.org.uk) by lungold.riddles.org.uk with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.88 (FreeBSD)) (envelope-from ) id 1gT3V9-0002fg-43; Sat, 01 Dec 2018 11:31:59 +0000 Received: from [127.0.0.1] (port=39118 helo=caithnard.riddles.org.uk) by caithnard.riddles.org.uk with esmtp (Exim 4.89 (FreeBSD)) (envelope-from ) id 1gT3V8-000NDa-CX; Sat, 01 Dec 2018 11:31:58 +0000 From: Andrew Gierth To: Pavel Stehule Cc: lulzimbilali@gmail.com, ypercube@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15533: error on upsert when used in a fuction and a function parameter has the same name as the column In-Reply-To: (Pavel Stehule's message of "Sat, 1 Dec 2018 12:17:28 +0100") Message-ID: <87y399lcfz.fsf@news-spur.riddles.org.uk> References: <15533-ac9506ee433a0d18@postgresql.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (berkeley-unix) Date: Sat, 01 Dec 2018 11:31:57 +0000 MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk >>>>> "Pavel" == Pavel Stehule writes: Pavel> I am strongly sure, so current default is best and any change of Pavel> this behave (it is simply - just use #option) is strongly wrong. I don't buy it; I call this a bug. Here's why: in an ON CONFLICT (col) clause, the (col) is not a list of expressions or even really a list of columns, what it is is an index definition (i.e. the same thing that would appear in CREATE INDEX). One consequence of this is that _qualified_ column names, which are a usual solution to variable name vs column conflicts, are not allowed here. There is already special processing done on the clause for this reason (the hiding of other tables that might be visible at this point in the query), and I would say that this simply doesn't go far enough and that parameters should be hidden too (by suppressing the columnref hooks while the arbiter clause is being analyzed). -- Andrew (irc:RhodiumToad)