pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: lulzimbilali@gmail.com
Cc: ypercube@gmail.com
Cc: 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
Date: Sat, 01 Dec 2018 11:31:57 +0000
Message-ID: <87y399lcfz.fsf@news-spur.riddles.org.uk> (raw)
In-Reply-To: <CAFj8pRA4kYRCxmuyDpy6_=CYtYXtxRf0=gcN3otbZzNoBHOXqg@mail.gmail.com>
References: <15533-ac9506ee433a0d18@postgresql.org>
	<CAE3TBxzoE9H8jY8L0fJ=BV2e7sHvSFEUaExYFqrVixBZG6x6qQ@mail.gmail.com>
	<CALeMZxkvSVtF_vurZKksh97kwT+ugJJh2XPiSTPdvO6=0Dr-xw@mail.gmail.com>
	<CAFj8pRA4kYRCxmuyDpy6_=CYtYXtxRf0=gcN3otbZzNoBHOXqg@mail.gmail.com>

>>>>> "Pavel" == Pavel Stehule <pavel.stehule@gmail.com> 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)




view thread (7+ messages)  latest in thread

Message-ID: <87y399lcfz.fsf@news-spur.riddles.org.uk>
Permalink:  ../87y399lcfz.fsf@news-spur.riddles.org.uk/
Also on:    postgresql.org/message-id/87y399lcfz.fsf@news-spur.riddles.org.uk

 · 

reply

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: andrew@tao11.riddles.org.uk, pavel.stehule@gmail.com, lulzimbilali@gmail.com, ypercube@gmail.com
  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: <87y399lcfz.fsf@news-spur.riddles.org.uk>
  References: <15533-ac9506ee433a0d18@postgresql.org> <CAE3TBxzoE9H8jY8L0fJ=BV2e7sHvSFEUaExYFqrVixBZG6x6qQ@mail.gmail.com> <CALeMZxkvSVtF_vurZKksh97kwT+ugJJh2XPiSTPdvO6=0Dr-xw@mail.gmail.com> <CAFj8pRA4kYRCxmuyDpy6_=CYtYXtxRf0=gcN3otbZzNoBHOXqg@mail.gmail.com> <87y399lcfz.fsf@news-spur.riddles.org.uk>

* 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