* SearchSysCacheAttNum * * This routine is equivalent to SearchSysCache on the ATTNUM 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. */
| 1557 | * though dropped attributes don't exist. |
| 1558 | */ |
| 1559 | HeapTuple |
| 1560 | SearchSysCacheAttNum(Oid relid, int16 attnum) |
| 1561 | { |
| 1562 | HeapTuple tuple; |
| 1563 | |
| 1564 | tuple = SearchSysCache2(ATTNUM, |
| 1565 | ObjectIdGetDatum(relid), |
| 1566 | Int16GetDatum(attnum)); |
| 1567 | if (!HeapTupleIsValid(tuple)) |
| 1568 | return NULL; |
| 1569 | if (((Form_pg_attribute) GETSTRUCT(tuple))->attisdropped) |
| 1570 | { |
| 1571 | ReleaseSysCache(tuple); |
| 1572 | return NULL; |
| 1573 | } |
| 1574 | return tuple; |
| 1575 | } |
| 1576 | |
| 1577 | /* |
| 1578 | * SearchSysCacheCopyAttNum |
no test coverage detected