pgsql: Allow RECORD and RECORD[] to be specified in function coldeflist

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Allow RECORD and RECORD[] to be specified in function coldeflist
Date: 2019-01-31 00:25:42
Message-ID: E1gp0Ao-0005lS-V2@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Allow RECORD and RECORD[] to be specified in function coldeflists.

We can't allow these pseudo-types to be used as table column types,
because storing an anonymous record value in a table would result
in data that couldn't be understood by other sessions. However,
it seems like there's no harm in allowing the case in a column
definition list that's specifying what a function-returning-record
returns. The data involved is all local to the current session,
so we should be just as able to resolve its actual tuple type as
we are for the function-returning-record's top-level tuple output.

Elvis Pranskevichus, with cosmetic changes by me

Discussion: https://postgr.es/m/11038447.kQ5A9Uj5xi@hammer.magicstack.net

Branch
------
master

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

Modified Files
--------------
src/backend/catalog/heap.c | 48 +++++++++++++++++++++++++---------
src/backend/catalog/index.c | 2 +-
src/backend/commands/tablecmds.c | 4 +--
src/backend/parser/parse_relation.c | 10 +++++--
src/include/catalog/heap.h | 8 ++++--
src/test/regress/expected/rowtypes.out | 11 ++++++++
src/test/regress/sql/rowtypes.sql | 6 +++++
7 files changed, 70 insertions(+), 19 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2019-01-31 04:18:12 pgsql: Add --min-xid-age and --min-mxid-age options to vacuumdb
Previous Message Peter Eisentraut 2019-01-30 22:29:04 pgsql: Log PostgreSQL version number on startup