pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Peter Geoghegan <pg@bowt.ie>
Cc: anton.dutov@gmail.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #15960: ON CONFLICT Trying accessing to variables
Date: Thu, 15 Aug 2019 18:06:25 -0400
Message-ID: <31082.1565906785@sss.pgh.pa.us> (raw)
In-Reply-To: <20190815194213.hskbzb3vcpij5tiy@alap3.anarazel.de>
References: <15960-ea463c93a1f572db@postgresql.org>
	<CAH2-Wzm7KDqfuekQ4NGH_YimW-Jw7wYg82mJyNM_zi=7oXEiSA@mail.gmail.com>
	<34AB8A8F-1020-4800-9A06-577E038B3C50@anarazel.de>
	<CAH2-Wz=4bG6-Nj3152exty1HX1W_w5WqV-rNvo1Umcmk-_-22Q@mail.gmail.com>
	<20190815194213.hskbzb3vcpij5tiy@alap3.anarazel.de>

Andres Freund <andres@anarazel.de> writes:
> On 2019-08-15 10:09:14 -0700, Peter Geoghegan wrote:
>> On Thu, Aug 15, 2019 at 10:05 AM Andres Freund <andres@anarazel.de> wrote:
>>> Seems like it's more a question of preventing the hook from resolving things at that point?

>> I don't know.

> Seems like we'd just need a new EXPR_KIND_*, maybe
> EXPR_KIND_ARBITER_EXPRESSION, which plpgsql's column hook would just
> ignore.

It's already using EXPR_KIND_INDEX_EXPRESSION, so I doubt you need a
new exprkind; it'd be fine not to resolve plpgsql variables in CREATE
INDEX too.  Possibly the same could happen for some other exprkinds.

But I'm not really sure that having the hook discriminate against
particular exprkinds is a good idea, on two grounds:

1. It introduces user-visible inconsistency.  Despite the OP's opinion,
I am not convinced that having "id" behave differently here than it
would elsewhere is a good thing.

2. It seems like an inevitable source of future bugs, when somebody
changes something in a way that makes it desirable to resolve plpgsql
variables in a particular exprkind.  Yeah, that most likely means they
should have split that exprkind in two, but this is the sort of action
at a distance that's very unlikely to get noticed until too late.

Maybe it'd be a net positive despite these objections, but I do not
think it's a clear-cut win.

			regards, tom lane





view thread (7+ messages)  latest in thread

Message-ID: <31082.1565906785@sss.pgh.pa.us>
Permalink:  ../31082.1565906785@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/31082.1565906785@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, andres@anarazel.de, pg@bowt.ie
  Subject: Re: BUG #15960: ON CONFLICT Trying accessing to variables
  In-Reply-To: <31082.1565906785@sss.pgh.pa.us>
  References: <15960-ea463c93a1f572db@postgresql.org> <CAH2-Wzm7KDqfuekQ4NGH_YimW-Jw7wYg82mJyNM_zi=7oXEiSA@mail.gmail.com> <34AB8A8F-1020-4800-9A06-577E038B3C50@anarazel.de> <CAH2-Wz=4bG6-Nj3152exty1HX1W_w5WqV-rNvo1Umcmk-_-22Q@mail.gmail.com> <20190815194213.hskbzb3vcpij5tiy@alap3.anarazel.de> <31082.1565906785@sss.pgh.pa.us>

* 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