From 5d7c703a44101f0d686fb66f4ff671429f46a84c Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Tue, 23 Oct 2018 14:45:29 +0200 Subject: Remove get_attidentity() All existing uses can get this information more easily from the relation descriptor, so the detour through the syscache is not necessary. Reviewed-by: Michael Paquier --- src/backend/parser/parse_utilcmd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/backend/parser/parse_utilcmd.c') diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index d8387d43569..a6a2de94ea4 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -2919,6 +2919,7 @@ transformAlterTableStmt(Oid relid, AlterTableStmt *stmt, const char *queryString) { Relation rel; + TupleDesc tupdesc; ParseState *pstate; CreateStmtContext cxt; List *result; @@ -2938,6 +2939,7 @@ transformAlterTableStmt(Oid relid, AlterTableStmt *stmt, /* Caller is responsible for locking the relation */ rel = relation_open(relid, NoLock); + tupdesc = RelationGetDescr(rel); /* Set up pstate */ pstate = make_parsestate(NULL); @@ -3067,7 +3069,8 @@ transformAlterTableStmt(Oid relid, AlterTableStmt *stmt, * if attribute not found, something will error about it * later */ - if (attnum != InvalidAttrNumber && get_attidentity(relid, attnum)) + if (attnum != InvalidAttrNumber && + TupleDescAttr(tupdesc, attnum - 1)->attidentity) { Oid seq_relid = getOwnedSequence(relid, attnum); Oid typeOid = typenameTypeId(pstate, def->typeName); -- cgit v1.2.3