Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dJAln-0007U6-E5 for pgsql-hackers@arkaria.postgresql.org; Fri, 09 Jun 2017 03:39:31 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dJAln-00048e-0f for pgsql-hackers@arkaria.postgresql.org; Fri, 09 Jun 2017 03:39:31 +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 1dJAkG-0008RZ-3y for pgsql-hackers@postgresql.org; Fri, 09 Jun 2017 03:37:56 +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 1dJAkD-0002SH-9j for pgsql-hackers@postgresql.org; Fri, 09 Jun 2017 03:37:54 +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 v593bngm027104; Thu, 8 Jun 2017 23:37:49 -0400 From: Tom Lane To: Andres Freund cc: Mark Dilger , Regina Obe , PostgreSQL-development Subject: Re: PostgreSQL 10 changes in exclusion constraints - did something change? CASE WHEN behavior oddity In-reply-to: <20170609032619.crv3skkf7tvzj63j@alap3.anarazel.de> References: <20170603024503.yv6gxvkyx6mtc63m@alap3.anarazel.de> <7181.1496458380@sss.pgh.pa.us> <20170603031127.fqg7zjhfgbcbcank@alap3.anarazel.de> <4125B63A-886A-442D-9932-34F0D4F76D41@gmail.com> <20170604193521.ha6d5kpkdswmissm@alap3.anarazel.de> <63850C96-9570-4969-8074-7033DA4C334F@gmail.com> <20170604211942.aiavcbagsho5owcz@alap3.anarazel.de> <13450.1496861842@sss.pgh.pa.us> <25987.1496977553@sss.pgh.pa.us> <20170609032619.crv3skkf7tvzj63j@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Thu, 08 Jun 2017 20:26:19 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <27102.1496979469.1@sss.pgh.pa.us> Date: Thu, 08 Jun 2017 23:37:49 -0400 Message-ID: <27103.1496979469@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-06-08 23:05:53 -0400, Tom Lane wrote: >> ... The first >> attached patch does it that way, and it seems nice and clean, but I ran >> into a complete dead end while trying to extend it to handle related cases >> such as disallowing SRF-inside-aggregate or nested SRFs in FROM. > But, do we really need to handle those? IOW, isn't handling > CASE/COALESCE, which we can recognize early in parse analysis, > sufficient to error out here? It'd be a lot nicer if we could error > about SRF arguments to aggregates et al. during analysis rather than > execution, but there's not a comparably huge need to improve there. Yes, we already have guards for those cases, but they return fairly opaque error messages to the tune of "set-valued function called in context that cannot accept a set", because the executor hasn't enough context to do better. I'd like the messages to be more specific, like "set-valued function cannot appear within CASE" and so on. Anyway the point here is to evaluate different approaches to changing the parser on the basis of whether they *could* be extended to handle related cases. Whether we actually do that right now is less important. 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