Re: Possible mismatch between behaviour and documentation in CREATE FUNCTION - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: Possible mismatch between behaviour and documentation in CREATE FUNCTION
Date
Msg-id CAKFQuwYX7a5A=Kg3xtsGq51Jqe5VWLNH9Dos-LxvVwFgQJ5Hwg@mail.gmail.com
Whole thread
In response to Possible mismatch between behaviour and documentation in CREATE FUNCTION  (Isaac Morland <isaac.morland@gmail.com>)
List pgsql-hackers
On Friday, April 10, 2026, Isaac Morland <isaac.morland@gmail.com> wrote:
The documentation says that only BEGIN ATOMIC parses the function body at definition time. Whereas AS parses the function body at execution time:


(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:


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.

pgsql-hackers by date:

Previous
From: Isaac Morland
Date:
Subject: Possible mismatch between behaviour and documentation in CREATE FUNCTION
Next
From: SATYANARAYANA NARLAPURAM
Date:
Subject: Bug: Missing check_stack_depth() in GRAPH_TABLE rewriter