* SearchSysCacheAttName * * This routine is equivalent to SearchSysCache on the ATTNAME cache, * except that it will return NULL if the found attribute is marked * attisdropped. This is convenient for callers that want to act as * though dropped attributes don't exist. */
| 1494 | * though dropped attributes don't exist. |
| 1495 | */ |
| 1496 | HeapTuple |
| 1497 | SearchSysCacheAttName(Oid relid, const char *attname) |
| 1498 | { |
| 1499 | HeapTuple tuple; |
| 1500 | |
| 1501 | tuple = SearchSysCache2(ATTNAME, |
| 1502 | ObjectIdGetDatum(relid), |
| 1503 | CStringGetDatum(attname)); |
| 1504 | if (!HeapTupleIsValid(tuple)) |
| 1505 | return NULL; |
| 1506 | if (((Form_pg_attribute) GETSTRUCT(tuple))->attisdropped) |
| 1507 | { |
| 1508 | ReleaseSysCache(tuple); |
| 1509 | return NULL; |
| 1510 | } |
| 1511 | return tuple; |
| 1512 | } |
| 1513 | |
| 1514 | /* |
| 1515 | * SearchSysCacheCopyAttName |
no test coverage detected