* get_typsubscript * * Given the type OID, return the type's subscripting handler's OID, * if it has one. * * If typelemp isn't NULL, we also store the type's typelem value there. * This saves some callers an extra catalog lookup. */
| 3695 | * This saves some callers an extra catalog lookup. |
| 3696 | */ |
| 3697 | RegProcedure |
| 3698 | get_typsubscript(Oid typid, Oid *typelemp) |
| 3699 | { |
| 3700 | HeapTuple tp; |
| 3701 | |
| 3702 | tp = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid)); |
| 3703 | if (HeapTupleIsValid(tp)) |
| 3704 | { |
| 3705 | Form_pg_type typform = (Form_pg_type) GETSTRUCT(tp); |
| 3706 | RegProcedure handler = typform->typsubscript; |
| 3707 | |
| 3708 | if (typelemp) |
| 3709 | *typelemp = typform->typelem; |
| 3710 | ReleaseSysCache(tp); |
| 3711 | return handler; |
| 3712 | } |
| 3713 | else |
| 3714 | { |
| 3715 | if (typelemp) |
| 3716 | *typelemp = InvalidOid; |
| 3717 | return InvalidOid; |
| 3718 | } |
| 3719 | } |
| 3720 | |
| 3721 | /* |
| 3722 | * getSubscriptingRoutines |
no test coverage detected