return a Type structure, given a type id */ NB: caller must ReleaseSysCache the type tuple when done with it */
| 575 | /* return a Type structure, given a type id */ |
| 576 | /* NB: caller must ReleaseSysCache the type tuple when done with it */ |
| 577 | Type |
| 578 | typeidType(Oid id) |
| 579 | { |
| 580 | HeapTuple tup; |
| 581 | |
| 582 | tup = SearchSysCache1(TYPEOID, ObjectIdGetDatum(id)); |
| 583 | if (!HeapTupleIsValid(tup)) |
| 584 | elog(ERROR, "cache lookup failed for type %u", id); |
| 585 | return (Type) tup; |
| 586 | } |
| 587 | |
| 588 | /* given type (as type struct), return the type OID */ |
| 589 | Oid |
no test coverage detected