mirror of
https://github.com/postgres/postgres.git
synced 2025-06-20 15:22:23 +03:00
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
This commit is contained in:
@ -5505,7 +5505,7 @@ ATExecAddColumn(List **wqueue, AlteredTableInfo *tab, Relation rel,
|
||||
/* make sure datatype is legal for a column */
|
||||
CheckAttributeType(colDef->colname, typeOid, collOid,
|
||||
list_make1_oid(rel->rd_rel->reltype),
|
||||
false);
|
||||
0);
|
||||
|
||||
/* construct new attribute's pg_attribute entry */
|
||||
attribute.attrelid = myrelid;
|
||||
@ -9445,7 +9445,7 @@ ATPrepAlterColumnType(List **wqueue,
|
||||
/* make sure datatype is legal for a column */
|
||||
CheckAttributeType(colName, targettype, targetcollid,
|
||||
list_make1_oid(rel->rd_rel->reltype),
|
||||
false);
|
||||
0);
|
||||
|
||||
if (tab->relkind == RELKIND_RELATION ||
|
||||
tab->relkind == RELKIND_PARTITIONED_TABLE)
|
||||
|
Reference in New Issue
Block a user