mirror of
				https://github.com/postgres/postgres.git
				synced 2025-10-31 10:30:33 +03:00 
			
		
		
		
	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>
This commit is contained in:
		| @@ -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); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user