From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Test and document the behavior of initialization cross-refs in p
Date: Fri, 29 Oct 2021 16:45:47 +0000
Message-ID: <E1mgV0l-0000l4-Qf@gemulon.postgresql.org> (raw)
Test and document the behavior of initialization cross-refs in plpgsql.
We had a test showing that a variable isn't referenceable in its
own initialization expression, nor in prior ones in the same block.
It *is* referenceable in later expressions in the same block, but
AFAICS there is no test case exercising that. Add one, and also
add some error cases.
Also, document that this is possible, since the docs failed to
cover the point.
Per question from tomás at tuxteam. I don't feel any need to
back-patch this, but we should ensure we don't break it in future.
Discussion: https://postgr.es/m/20211029121435.GA5414@tuxteam.de
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/a2a731d6c9db0ba650aa6f7c4fe349ccf712f74d
Modified Files
--------------
doc/src/sgml/plpgsql.sgml | 12 ++++++++-
src/test/regress/expected/plpgsql.out | 48 +++++++++++++++++++++++++++--------
src/test/regress/sql/plpgsql.sql | 36 ++++++++++++++++++++------
3 files changed, 76 insertions(+), 20 deletions(-)
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Test and document the behavior of initialization cross-refs in p
In-Reply-To: <E1mgV0l-0000l4-Qf@gemulon.postgresql.org>
References: <E1mgV0l-0000l4-Qf@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox