aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_utilcmd.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2018-10-23 14:45:29 +0200
committerPeter Eisentraut <peter_e@gmx.net>2018-10-23 14:47:14 +0200
commit5d7c703a44101f0d686fb66f4ff671429f46a84c (patch)
tree2b101e37b1756b229a4b3da3a9c4dacb9381e696 /src/backend/parser/parse_utilcmd.c
parentc903bb7b1c3ce82e21d6bd1af1dc45a58cd88455 (diff)
downloadpostgresql-5d7c703a44101f0d686fb66f4ff671429f46a84c.tar.gz
postgresql-5d7c703a44101f0d686fb66f4ff671429f46a84c.zip
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 <michael@paquier.xyz>
Diffstat (limited to 'src/backend/parser/parse_utilcmd.c')
-rw-r--r--src/backend/parser/parse_utilcmd.c5
1 files changed, 4 insertions, 1 deletions
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);