Skip to content

Commit 180e339

Browse files
committed
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/52a125e4-ff9a-95f5-9f61-b87cf447e4da@eisentraut.org
1 parent 04e4852 commit 180e339

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/backend/commands/tablecmds.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -940,10 +940,6 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId,
940940
cookedDefaults = lappend(cookedDefaults, cooked);
941941
attr->atthasdef = true;
942942
}
943-
944-
attr->attcompression = GetAttributeCompression(attr->atttypid, colDef->compression);
945-
if (colDef->storage_name)
946-
attr->attstorage = GetAttributeStorage(attr->atttypid, colDef->storage_name);
947943
}
948944

949945
/*
@@ -1346,8 +1342,6 @@ BuildDescForRelation(const List *columns)
13461342

13471343
/* Override TupleDescInitEntry's settings as requested */
13481344
TupleDescInitEntryCollation(desc, attnum, attcollation);
1349-
if (entry->storage)
1350-
att->attstorage = entry->storage;
13511345

13521346
/* Fill in additional stuff not handled by TupleDescInitEntry */
13531347
att->attnotnull = entry->is_not_null;
@@ -1356,6 +1350,11 @@ BuildDescForRelation(const List *columns)
13561350
att->attinhcount = entry->inhcount;
13571351
att->attidentity = entry->identity;
13581352
att->attgenerated = entry->generated;
1353+
att->attcompression = GetAttributeCompression(att->atttypid, entry->compression);
1354+
if (entry->storage)
1355+
att->attstorage = entry->storage;
1356+
else if (entry->storage_name)
1357+
att->attstorage = GetAttributeStorage(att->atttypid, entry->storage_name);
13591358
}
13601359

13611360
if (has_not_null)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy