public inbox for [email protected]  
help / color / mirror / Atom feed
From: David G. Johnston <[email protected]>
To: Isaac Morland <[email protected]>
Cc: PostgreSQL Developers <[email protected]>
Subject: Re: Possible mismatch between behaviour and documentation in CREATE FUNCTION
Date: Fri, 10 Apr 2026 20:53:39 -0700
Message-ID: <CAKFQuwYX7a5A=Kg3xtsGq51Jqe5VWLNH9Dos-LxvVwFgQJ5Hwg@mail.gmail.com> (raw)
In-Reply-To: <CAMsGm5c7F-mRshFO=TOvnX+9WgmTPnzRMTnfqjOMOCfWj4GWEQ@mail.gmail.com>
References: <CAMsGm5c7F-mRshFO=TOvnX+9WgmTPnzRMTnfqjOMOCfWj4GWEQ@mail.gmail.com>

On Friday, April 10, 2026, Isaac Morland <[email protected]> wrote:

> The documentation says that only BEGIN ATOMIC parses the function body at
> definition time. Whereas AS parses the function body at execution time:
>
> https://www.postgresql.org/docs/current/sql-createfunction.html
>
> (and look at the explanation of sql_body)
>

Possibly some documentation tweaks are in order.  I haven’t looked at it in
depth.  The optional checks are able to be disabled:

https://www.postgresql.org/docs/current/runtime-config-client.html#RUNTIME-CONFIG-CLIENT-STATEMENT

While the result of the required parsing of a function body is implying
that such parsing is saved to the catalogs so that creation-time object
references are retained.  While the others are re-parsed during execution
and object references retained only for the lifetime of the query.

David J.


view thread (2+ messages)

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Possible mismatch between behaviour and documentation in CREATE FUNCTION
  In-Reply-To: <CAKFQuwYX7a5A=Kg3xtsGq51Jqe5VWLNH9Dos-LxvVwFgQJ5Hwg@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox