* FuncNameAsType - * convenience routine to see if a function name matches a type name * * Returns the OID of the matching type, or InvalidOid if none. We ignore * shell types and complex types. */
| 1933 | * shell types and complex types. |
| 1934 | */ |
| 1935 | static Oid |
| 1936 | FuncNameAsType(List *funcname) |
| 1937 | { |
| 1938 | Oid result; |
| 1939 | Type typtup; |
| 1940 | |
| 1941 | /* |
| 1942 | * temp_ok=false protects the <refsect1 id="sql-createfunction-security"> |
| 1943 | * contract for writing SECURITY DEFINER functions safely. |
| 1944 | */ |
| 1945 | typtup = LookupTypeNameExtended(NULL, makeTypeNameFromNameList(funcname), |
| 1946 | NULL, false, false); |
| 1947 | if (typtup == NULL) |
| 1948 | return InvalidOid; |
| 1949 | |
| 1950 | if (((Form_pg_type) GETSTRUCT(typtup))->typisdefined && |
| 1951 | !OidIsValid(typeTypeRelid(typtup))) |
| 1952 | result = typeTypeId(typtup); |
| 1953 | else |
| 1954 | result = InvalidOid; |
| 1955 | |
| 1956 | ReleaseSysCache(typtup); |
| 1957 | return result; |
| 1958 | } |
| 1959 | |
| 1960 | /* |
| 1961 | * ParseComplexProjection - |
no test coverage detected