Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wBPPl-00122P-2X for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Apr 2026 03:53:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wBPPk-00FTQm-01 for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Apr 2026 03:53:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wBPPj-00FTQd-2I for pgsql-hackers@lists.postgresql.org; Sat, 11 Apr 2026 03:53:44 +0000 Received: from mail-yx1-xb12d.google.com ([2607:f8b0:4864:20::b12d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wBPPi-00000000Sef-1I53 for pgsql-hackers@lists.postgresql.org; Sat, 11 Apr 2026 03:53:44 +0000 Received: by mail-yx1-xb12d.google.com with SMTP id 956f58d0204a3-6500040ef83so2059826d50.2 for ; Fri, 10 Apr 2026 20:53:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775879620; cv=none; d=google.com; s=arc-20240605; b=aYF1w2XMljrKwnNjqe14e7E73cE1EMKtfB9RNHEEZFH+sh+ebplayPPv6D02ubb4nE csmRBWPcLZL+FCPVGdAEFGK2iMuVTuJaJeJa2NOR4zuLOkUDGGRk84vulRUHBeZrZbDc 4rRtvsqNCtoDyRtbinTERJRjwUWYSRpwDU1ICRfp4XHS8EITtVg6J+v9Tv6goVSzMIdw Xmjzb+PhvzV6XVLE7e4AZdfAAcc5i+iPLnxXU5z13XysnB9NBR7PHB/mYGUwWdzwenU2 GhsC/WJ3YKeMO2DsSuybpP7lpAIrz/ZM/jtxXziR1mgkW2opTze2LHNCreUIA93wLkrP zILA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:dkim-signature; bh=sWyWDQHzDwXNrnIVewEJ2/xKRaOMKunYhjRVu8lvXis=; fh=Z6rxv3bGI2UY5h+7asZmD8+5iC/aMJOVUKivrvvRcsY=; b=SxnuxUnusZuDiIOUhvH5dFnksICdpjJwNcRFWg9P0Dor/tavBEvRpUNlmLTQL1VUQS lx7pV7FI8I6wKhilHMOxAF0a9ZRD0/edRaEnI3r+bPaktzFdKzuGchlfUYUtbn+paLpQ FBUdMADax4mIxcsI+R2COcAlgiEM+L5cSlPs+IzNozZKnh1ekOnoAD962qW27WyYMYS4 laDqUTMUNj0nrIzC3VQGtq14eRDLp7OiHHUFoNgIAIaLo1hU+kyTqFzBjvWj8PQ6F5Vp kYeJ7TkSdw2N8Makex0n5Ntg7MPkxK1vMfmiuZEsM9A9Y1ifwAoxpsLPFg2gxRPW+hrK q+VA==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775879620; x=1776484420; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=sWyWDQHzDwXNrnIVewEJ2/xKRaOMKunYhjRVu8lvXis=; b=Ebc0Dn6wH8V80dUBq/CB7nORDx/zUx8kKFvZJolk/C2kEJtzli8ilBC8anX44MbJ+s S8hVj1JDh5uNWbhofhlKxdMLzq8t21KM4a7xQVOL3G2MnJ2oozYoA3C14enG1IfR7Dq1 fi2Q6oswOEMFUun8g+GaMYuJKLyYnzHBE0JvEEeCQyc5QFodX8TQCpe8frYr2pQdcOKb a/w4h4macGSeJz5kKhReOWKegW35397aCTl6IR2TlCMbL7Rtrv/+ot/MV0jQq7v3EYpa rxRZxLsNrM6qKjoKyAOJveOk9d6zQhjHkceYvGuGVOKbcbKoCnS6bl0gcvIZixbL9uoq F0lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775879620; x=1776484420; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=sWyWDQHzDwXNrnIVewEJ2/xKRaOMKunYhjRVu8lvXis=; b=HHi4+lMzU6ec/cuUbQ759VOSIcz8KPEL3YjkoFHZQpXK6NGS11CDYcv4MINcQebmzk hnSG9shbD6SU/RPYu9Ecvih7brxAjfdOe9Y7pw1vhKkW34pVGyOHJV5Vesjps3tk90Lu AbWdFsnJQ+EUXRWa7ZqMhXOKAsAWEJDbnm7fgcuBxQHDuHZZ5yK9WGfyX1VPERsTo6AH rKeyDTwRAx5J8HqS7+XC5Ldx0+NmuZ40eGpOZhblpwdu2Jzc11j0RIWVzFeN6Uo+4trf 5K23QH6LhHAeeBPcVGWOJgi3aDlXm0QPzuUkUq5HYKGwmUjDejGQvg4dfU60w1ccSZM8 YrnA== X-Gm-Message-State: AOJu0YwF+sS4RhCVhRm0hkRwOCKNCaFmWoOBD2NRbiwYvZfsAyzUbIzG RXFjAjON6IMkF2LcctYpo+noVytKaWeB5A8RwSz0AI5zKWi2A56PMb8Bc3tCISbDcP3tTMJJ2/F dhPAJ6rU2/EBD+NmDk5OX78rI2ZfLZ3muozwO X-Gm-Gg: AeBDieu9/jMDgnQwGI96w76TMvQ78DIxVbKW1fiTNpeQlj5Quj0YwlKjSra1OJbIy0V yIAD0ALpT3sWgSI0vSmtHEkzyJCSX2B7S4JrQ5d7V3nufUH7dNAl6SVJNSSnQkc/JKNKj4nOTLG Y81RET92DFUU33H5V1kMEgvE4hIEghgBnJD2uAwbxOYFKGRlP4a5W/j5SJPT/M02GZJIPE3twCc rGb7hsZEZOXq/WUdh7vpYW4hdmhPOjaiCS8ZVmWRZZvIcFQo7z2y2LIj0kVs7UL48CoJqTRbOtQ ltoDbuc= X-Received: by 2002:a53:b403:0:b0:64c:e789:4397 with SMTP id 956f58d0204a3-65198a6cb22mr4189688d50.10.1775879620450; Fri, 10 Apr 2026 20:53:40 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:7010:7a87:b0:4eb:d547:b156 with HTTP; Fri, 10 Apr 2026 20:53:39 -0700 (PDT) In-Reply-To: References: From: "David G. Johnston" Date: Fri, 10 Apr 2026 20:53:39 -0700 X-Gm-Features: AQROBzANif5LXIL5AGMNs-wqzVnttcKrIklm2wti_ZPxe0YHdZqpglahSTm7D4c Message-ID: Subject: Re: Possible mismatch between behaviour and documentation in CREATE FUNCTION To: Isaac Morland Cc: PostgreSQL Developers Content-Type: multipart/alternative; boundary="000000000000f0ddb9064f2731c5" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000f0ddb9064f2731c5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Friday, April 10, 2026, Isaac Morland 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=E2=80=99t 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. --000000000000f0ddb9064f2731c5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Friday, April 10, 2026, Isaac Morland <isaac.morland@gmail.com> wrote:
The documentation says that only BEGIN ATOMIC p= arses the function body at definition time. Whereas AS parses the function = body at execution time:

<= div>
(and look at the explanation of sql_body)

Possibly some documentation tweaks are in ord= er.=C2=A0 I haven=E2=80=99t looked at it in depth.=C2=A0 The optional check= s are able to be disabled:


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

<= /div>
David J.

--000000000000f0ddb9064f2731c5--