Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jqdVG-0004OV-8H for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Jul 2020 14:14:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jqdVF-0007ON-0F for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Jul 2020 14:14:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jqdVE-0007OG-Pj for pgsql-hackers@lists.postgresql.org; Wed, 01 Jul 2020 14:14:20 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jqdV7-0006Td-VO for pgsql-hackers@postgresql.org; Wed, 01 Jul 2020 14:14:20 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 061EEA88582468; Wed, 1 Jul 2020 10:14:10 -0400 From: Tom Lane To: Robert Haas cc: Peter Eisentraut , pgsql-hackers Subject: Re: SQL-standard function body In-reply-to: References: <1c11f1eb-f00c-43b7-799d-2d44132c02d7@2ndquadrant.com> <493812.1593541480@sss.pgh.pa.us> <494838.1593543098@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Wed, 01 Jul 2020 09:36:42 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <582466.1593612850.1@sss.pgh.pa.us> Date: Wed, 01 Jul 2020 10:14:10 -0400 Message-ID: <582467.1593612850@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Robert Haas writes: > In my experience, there's certainly demand for some kind of mode where > plpgsql functions get checked at function definition time, rather than > at execution time. Yeah, absolutely agreed. But I'm afraid this proposal takes us too far in the other direction: with this, you *must* have a 100% parseable and semantically valid function body, every time all the time. So far as plpgsql is concerned, I could see extending the validator to run parse analysis (not just raw parsing) on all SQL statements in the body. This wouldn't happen of course with check_function_bodies off, so it wouldn't affect dump/reload. But likely there would still be demand for more fine-grained control over it ... or maybe it could stop doing analysis as soon as it finds a DDL command? regards, tom lane