* get_func_name * returns the name of the function with the given funcid * * Note: returns a palloc'd copy of the string, or NULL if no such function. */
| 1899 | * Note: returns a palloc'd copy of the string, or NULL if no such function. |
| 1900 | */ |
| 1901 | char * |
| 1902 | get_func_name(Oid funcid) |
| 1903 | { |
| 1904 | HeapTuple tp; |
| 1905 | |
| 1906 | tp = SearchSysCache1(PROCOID, ObjectIdGetDatum(funcid)); |
| 1907 | if (HeapTupleIsValid(tp)) |
| 1908 | { |
| 1909 | Form_pg_proc functup = (Form_pg_proc) GETSTRUCT(tp); |
| 1910 | char *result; |
| 1911 | |
| 1912 | result = pstrdup(NameStr(functup->proname)); |
| 1913 | ReleaseSysCache(tp); |
| 1914 | return result; |
| 1915 | } |
| 1916 | else |
| 1917 | return NULL; |
| 1918 | } |
| 1919 | |
| 1920 | /* |
| 1921 | * get_type_name |
no test coverage detected