pgsql: In plpgsql, allow %TYPE and %ROWTYPE to be followed by array dec

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: In plpgsql, allow %TYPE and %ROWTYPE to be followed by array dec
Date: 2024-01-04 20:24:21
Message-ID: E1rLUGL-00DVla-80@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

In plpgsql, allow %TYPE and %ROWTYPE to be followed by array decoration.

This provides the useful ability to declare a variable that is an array
of the type of some other variable or some table column.

Quan Zongliang, Pavel Stehule

Discussion: https://postgr.es/m/ec4523e1-9e7e-f3ef-f9ce-bafd680ad6f6@yeah.net

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5e8674dc83926f52516f847f1a77e8d38e94e143

Modified Files
--------------
doc/src/sgml/plpgsql.sgml | 29 ++++++++-
src/pl/plpgsql/src/expected/plpgsql_array.out | 79 ++++++++++++++++++++++++
src/pl/plpgsql/src/pl_comp.c | 27 +++++++++
src/pl/plpgsql/src/pl_gram.y | 86 ++++++++++++++++++---------
src/pl/plpgsql/src/plpgsql.h | 1 +
src/pl/plpgsql/src/sql/plpgsql_array.sql | 71 ++++++++++++++++++++++
6 files changed, 261 insertions(+), 32 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Nathan Bossart 2024-01-04 22:11:29 pgsql: Add macros for looping through a List without a ListCell.
Previous Message Peter Eisentraut 2024-01-04 15:46:04 pgsql: ALTER TABLE command to change generation expression