Skip to content

Commit 6974f57

Browse files
peterepull[bot]
authored andcommitted
Push attidentity and attgenerated handling into BuildDescForRelation()
Previously, this was handled by the callers separately, but it can be trivially moved into BuildDescForRelation() so that it is handled in a central place. Reviewed-by: Alvaro Herrera <alvherre@alvh.no-ip.org> Discussion: https://www.postgresql.org/message-id/flat/52a125e4-ff9a-95f5-9f61-b87cf447e4da@eisentraut.org
1 parent 70efff3 commit 6974f57

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/backend/access/common/tupdesc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,8 @@ BuildDescForRelation(const List *columns)
856856
has_not_null |= entry->is_not_null;
857857
att->attislocal = entry->is_local;
858858
att->attinhcount = entry->inhcount;
859+
att->attidentity = entry->identity;
860+
att->attgenerated = entry->generated;
859861
}
860862

861863
if (has_not_null)

src/backend/commands/tablecmds.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -941,8 +941,6 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId,
941941
attr->atthasdef = true;
942942
}
943943

944-
attr->attidentity = colDef->identity;
945-
attr->attgenerated = colDef->generated;
946944
attr->attcompression = GetAttributeCompression(attr->atttypid, colDef->compression);
947945
if (colDef->storage_name)
948946
attr->attstorage = GetAttributeStorage(attr->atttypid, colDef->storage_name);

0 commit comments

Comments
 (0)