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

Function getFormattedOperatorName

src/bin/pg_dump/pg_dump.c:14444–14464  ·  view source on GitHub ↗

* getFormattedOperatorName - retrieve the operator name for the * given operator OID (presented in string form). * * Returns an allocated string, or NULL if the given OID is invalid. * Caller is responsible for free'ing result string. * * What we produce has the format "OPERATOR(schema.oprname)". This is only * useful in commands where the operator's argument types can be inferred from *

Source from the content-addressed store, hash-verified

14442 * are in different schemas.
14443 */
14444static char *
14445getFormattedOperatorName(const char *oproid)
14446{
14447 OprInfo *oprInfo;
14448
14449 /* In all cases "0" means a null reference */
14450 if (strcmp(oproid, "0") == 0)
14451 return NULL;
14452
14453 oprInfo = findOprByOid(atooid(oproid));
14454 if (oprInfo == NULL)
14455 {
14456 pg_log_warning("could not find operator with OID %s",
14457 oproid);
14458 return NULL;
14459 }
14460
14461 return psprintf("OPERATOR(%s.%s)",
14462 fmtId(oprInfo->dobj.namespace->dobj.name),
14463 oprInfo->dobj.name);
14464}
14465
14466/*
14467 * Convert a function OID obtained from pg_ts_parser or pg_ts_template

Callers 2

dumpOprFunction · 0.85
dumpAggFunction · 0.85

Calls 3

findOprByOidFunction · 0.85
psprintfFunction · 0.85
fmtIdFunction · 0.85

Tested by

no test coverage detected