Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dGzD5-0006VV-Jn for pgsql-hackers@arkaria.postgresql.org; Sat, 03 Jun 2017 02:54:39 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dGzD4-0004HJ-Mr for pgsql-hackers@arkaria.postgresql.org; Sat, 03 Jun 2017 02:54:38 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dGzBa-0001ZN-0X for pgsql-hackers@postgresql.org; Sat, 03 Jun 2017 02:53:06 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dGzBX-0006NP-Iu for pgsql-hackers@postgresql.org; Sat, 03 Jun 2017 02:53:04 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v532r0bt007182; Fri, 2 Jun 2017 22:53:00 -0400 From: Tom Lane To: Andres Freund cc: Regina Obe , "'PostgreSQL-development'" Subject: Re: PostgreSQL 10 changes in exclusion constraints - did something change? CASE WHEN behavior oddity 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> Comments: In-reply-to Andres Freund message dated "Fri, 02 Jun 2017 19:45:03 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7180.1496458380.1@sss.pgh.pa.us> Date: Fri, 02 Jun 2017 22:53:00 -0400 Message-ID: <7181.1496458380@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Andres Freund 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