* get_typlen * * Given the type OID, return the length of the type. */
| 2795 | * Given the type OID, return the length of the type. |
| 2796 | */ |
| 2797 | int16 |
| 2798 | get_typlen(Oid typid) |
| 2799 | { |
| 2800 | HeapTuple tp; |
| 2801 | |
| 2802 | tp = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid)); |
| 2803 | if (HeapTupleIsValid(tp)) |
| 2804 | { |
| 2805 | Form_pg_type typtup = (Form_pg_type) GETSTRUCT(tp); |
| 2806 | int16 result; |
| 2807 | |
| 2808 | result = typtup->typlen; |
| 2809 | ReleaseSysCache(tp); |
| 2810 | return result; |
| 2811 | } |
| 2812 | else |
| 2813 | return 0; |
| 2814 | } |
| 2815 | |
| 2816 | /* |
| 2817 | * get_typbyval |
no test coverage detected