From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Regina Obe <lr@pcorp.us>
Cc: 'PostgreSQL-development' <pgsql-hackers@postgresql.org>
Subject: Re: PostgreSQL 10 changes in exclusion constraints - did something change? CASE WHEN behavior oddity
Date: Fri, 02 Jun 2017 22:53:00 -0400
Message-ID: <7181.1496458380@sss.pgh.pa.us> (raw)
In-Reply-To: <20170603024503.yv6gxvkyx6mtc63m@alap3.anarazel.de>
References: <000001d2d5de$d8d66170$8a832450$@pcorp.us>
<29994.1495809534@sss.pgh.pa.us>
<000c01d2d654$518f2be0$f4ad83a0$@pcorp.us>
<21809.1495994606@sss.pgh.pa.us>
<20170603024503.yv6gxvkyx6mtc63m@alap3.anarazel.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Andres Freund <andres@anarazel.de> writes:
> On 2017-05-28 14:03:26 -0400, Tom Lane wrote:
>> I think it would be possible to teach eval_const_expressions that
>> it must not discard CASE/COALESCE subexpressions that contain SRFs,
>> which would preserve the rule that expression simplification doesn't
>> change the query semantics.
> That sounds like a good idea. Do you want to write up a patch, or
> should I? I can, but I'd want to finish the walsender panic and other
> signal handling stuff first (mostly waiting for review for now).
I think you've got enough on your plate. I can take care of whatever
we decide to do here. What I was looking for was opinions on which
way to address it.
>> Another possibility is to say that we've broken this situation
>> irretrievably and we should start throwing errors for SRFs in
>> places where they'd be conditionally evaluated. That's not real
>> nice perhaps, but it's better than the way things are right now.
> I'd be ok with that too, but I don't really see a strong need so far.
The argument for this way is basically that it's better to break
apps visibly than silently. The behavior for SRF-inside-CASE is
not going to be the same as before even if we implement the fix
I suggest above, and it's arguable that this new behavior is not
at all intuitive.
I'm not really sure which way to jump, which is why I was hoping
for some discussion here.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, lr@pcorp.us
Subject: Re: PostgreSQL 10 changes in exclusion constraints - did something change? CASE WHEN behavior oddity
In-Reply-To: <7181.1496458380@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