1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-08 11:42:09 +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:
Peter Eisentraut
2018-10-23 14:45:29 +02:00
parent c903bb7b1c
commit 5d7c703a44
4 changed files with 12 additions and 41 deletions

View File

@ -821,38 +821,6 @@ get_attnum(Oid relid, const char *attname)
return InvalidAttrNumber;
}
/*
* get_attidentity
*
* Given the relation id and the attribute name,
* return the "attidentity" field from the attribute relation.
*
* Returns '\0' if not found.
*
* Since no identity is represented by '\0', this can also be used as a
* Boolean test.
*/
char
get_attidentity(Oid relid, AttrNumber attnum)
{
HeapTuple tp;
tp = SearchSysCache2(ATTNUM,
ObjectIdGetDatum(relid),
Int16GetDatum(attnum));
if (HeapTupleIsValid(tp))
{
Form_pg_attribute att_tup = (Form_pg_attribute) GETSTRUCT(tp);
char result;
result = att_tup->attidentity;
ReleaseSysCache(tp);
return result;
}
else
return '\0';
}
/*
* get_atttype
*