diff options
author | Peter Eisentraut | 2023-10-05 14:17:16 +0000 |
---|---|---|
committer | Peter Eisentraut | 2023-10-05 14:20:46 +0000 |
commit | 180e3394a7042f6cefa53221bfa224db906671d3 (patch) | |
tree | 1d6953816dc8c1f7be5156927c3dc097f5921b05 | |
parent | 04e485273b56bec0e4637f97c587eca26cf823f0 (diff) |
Push attcompression and attstorage handling into BuildDescForRelation()
This was previously handled by the callers but it can be moved into a
common place.
Discussion: https://www.postgresql.org/message-id/flat/[email protected]
-rw-r--r-- | src/backend/commands/tablecmds.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 7bd73eb379..8820738d91 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -940,10 +940,6 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, cookedDefaults = lappend(cookedDefaults, cooked); attr->atthasdef = true; } - - attr->attcompression = GetAttributeCompression(attr->atttypid, colDef->compression); - if (colDef->storage_name) - attr->attstorage = GetAttributeStorage(attr->atttypid, colDef->storage_name); } /* @@ -1346,8 +1342,6 @@ BuildDescForRelation(const List *columns) /* Override TupleDescInitEntry's settings as requested */ TupleDescInitEntryCollation(desc, attnum, attcollation); - if (entry->storage) - att->attstorage = entry->storage; /* Fill in additional stuff not handled by TupleDescInitEntry */ att->attnotnull = entry->is_not_null; @@ -1356,6 +1350,11 @@ BuildDescForRelation(const List *columns) att->attinhcount = entry->inhcount; att->attidentity = entry->identity; att->attgenerated = entry->generated; + att->attcompression = GetAttributeCompression(att->atttypid, entry->compression); + if (entry->storage) + att->attstorage = entry->storage; + else if (entry->storage_name) + att->attstorage = GetAttributeStorage(att->atttypid, entry->storage_name); } if (has_not_null) |