MCPcopy Create free account
hub / github.com/apache/cloudberry / IsThereFunctionInNamespace

Function IsThereFunctionInNamespace

src/backend/commands/functioncmds.c:2565–2580  ·  view source on GitHub ↗

* Subroutine for ALTER FUNCTION/AGGREGATE SET SCHEMA/RENAME * * Is there a function with the given name and signature already in the given * namespace? If so, raise an appropriate error message. */

Source from the content-addressed store, hash-verified

2563 * namespace? If so, raise an appropriate error message.
2564 */
2565void
2566IsThereFunctionInNamespace(const char *proname, int pronargs,
2567 oidvector *proargtypes, Oid nspOid)
2568{
2569 /* check for duplicate name (more friendly than unique-index failure) */
2570 if (SearchSysCacheExists3(PROCNAMEARGSNSP,
2571 CStringGetDatum(proname),
2572 PointerGetDatum(proargtypes),
2573 ObjectIdGetDatum(nspOid)))
2574 ereport(ERROR,
2575 (errcode(ERRCODE_DUPLICATE_FUNCTION),
2576 errmsg("function %s already exists in schema \"%s\"",
2577 funcname_signature_string(proname, pronargs,
2578 NIL, proargtypes->values),
2579 get_namespace_name(nspOid))));
2580}
2581
2582/*
2583 * ExecuteDoStmt

Callers 2

Calls 6

CStringGetDatumFunction · 0.85
ObjectIdGetDatumFunction · 0.85
get_namespace_nameFunction · 0.85
errcodeFunction · 0.50
errmsgFunction · 0.50

Tested by

no test coverage detected