Allow RECORD and RECORD[] to be specified in function coldeflists.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 31 Jan 2019 00:25:33 +0000 (19:25 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 31 Jan 2019 00:25:33 +0000 (19:25 -0500)
commit5f5c01459053c0975b89b5aa1a3d705e677348ae
tree881c6257801ac67d184cee602fbfada069941fc2
parent689d15e95e3509554fbc1afd231b41f4a1fee669
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
src/backend/catalog/heap.c
src/backend/catalog/index.c
src/backend/commands/tablecmds.c
src/backend/parser/parse_relation.c
src/include/catalog/heap.h
src/test/regress/expected/rowtypes.out
src/test/regress/sql/rowtypes.sql