mirror of
https://github.com/postgres/postgres.git
synced 2025-09-11 00:12:06 +03:00
Move BuildDescForRelation() from tupdesc.c to tablecmds.c
BuildDescForRelation() main job is to convert ColumnDef lists to pg_attribute/tuple descriptor arrays, which is really mostly an internal subroutine of DefineRelation() and some related functions, which is more the remit of tablecmds.c and doesn't have much to do with the basic tuple descriptor interfaces in tupdesc.c. This is also supported by observing the header includes we can remove in tupdesc.c. By moving it over, we can also (in the future) make BuildDescForRelation() use more internals of tablecmds.c that are not sensible to be exposed in tupdesc.c. Discussion: https://www.postgresql.org/message-id/flat/52a125e4-ff9a-95f5-9f61-b87cf447e4da@eisentraut.org
This commit is contained in:
@@ -147,8 +147,6 @@ extern void TupleDescInitEntryCollation(TupleDesc desc,
|
||||
AttrNumber attributeNumber,
|
||||
Oid collationid);
|
||||
|
||||
extern TupleDesc BuildDescForRelation(const List *columns);
|
||||
|
||||
extern TupleDesc BuildDescFromLists(const List *names, const List *types, const List *typmods, const List *collations);
|
||||
|
||||
extern Node *TupleDescGetDefault(TupleDesc tupdesc, AttrNumber attnum);
|
||||
|
@@ -27,6 +27,8 @@ struct AlterTableUtilityContext; /* avoid including tcop/utility.h here */
|
||||
extern ObjectAddress DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId,
|
||||
ObjectAddress *typaddress, const char *queryString);
|
||||
|
||||
extern TupleDesc BuildDescForRelation(const List *columns);
|
||||
|
||||
extern void RemoveRelations(DropStmt *drop);
|
||||
|
||||
extern Oid AlterTableLookupRelation(AlterTableStmt *stmt, LOCKMODE lockmode);
|
||||
|
Reference in New Issue
Block a user