49 List **names,
int *nargs,
Oid *argtypes,
69 Node *escontext = fcinfo->context;
85 elog(
ERROR,
"regproc values must be OIDs in bootstrap mode");
99 (
errcode(ERRCODE_UNDEFINED_FUNCTION),
100 errmsg(
"function \"%s\" does not exist", pro_name_or_oid)));
101 else if (clist->
next != NULL)
103 (
errcode(ERRCODE_AMBIGUOUS_FUNCTION),
104 errmsg(
"more than one function named \"%s\"",
172 -1,
NIL,
false,
false,
false,
false);
173 if (clist != NULL && clist->
next == NULL &&
227 Node *escontext = fcinfo->context;
240 elog(
ERROR,
"regprocedure values must be OIDs in bootstrap mode");
249 &names, &nargs, argtypes,
256 for (; clist; clist = clist->
next)
258 if (memcmp(clist->
args, argtypes, nargs *
sizeof(
Oid)) == 0)
264 (
errcode(ERRCODE_UNDEFINED_FUNCTION),
265 errmsg(
"function \"%s\" does not exist", pro_name_or_oid)));
337 int nargs = procform->pronargs;
359 for (
i = 0;
i < nargs;
i++)
361 Oid thisargtype = procform->proargtypes.values[
i];
411 elog(
ERROR,
"cache lookup failed for procedure with OID %u", procedure_oid);
416 nargs = procform->pronargs;
421 for (
i = 0;
i < nargs;
i++)
423 Oid thisargtype = procform->proargtypes.values[
i];
481 Node *escontext = fcinfo->context;
494 elog(
ERROR,
"regoper values must be OIDs in bootstrap mode");
508 (
errcode(ERRCODE_UNDEFINED_FUNCTION),
509 errmsg(
"operator does not exist: %s", opr_name_or_oid)));
510 else if (clist->
next != NULL)
512 (
errcode(ERRCODE_AMBIGUOUS_FUNCTION),
513 errmsg(
"more than one operator named %s",
562 char *oprname =
NameStr(operform->oprname);
581 if (clist != NULL && clist->
next == NULL &&
590 result = (
char *)
palloc(strlen(nspname) + strlen(oprname) + 2);
591 sprintf(result,
"%s.%s", nspname, oprname);
642 Node *escontext = fcinfo->context;
654 elog(
ERROR,
"regoperator values must be OIDs in bootstrap mode");
663 &names, &nargs, argtypes,
669 (
errcode(ERRCODE_UNDEFINED_PARAMETER),
670 errmsg(
"missing argument"),
671 errhint(
"Use NONE to denote the missing argument of a unary operator.")));
674 (
errcode(ERRCODE_TOO_MANY_ARGUMENTS),
675 errmsg(
"too many arguments"),
676 errhint(
"Provide two argument types for operator.")));
682 (
errcode(ERRCODE_UNDEFINED_FUNCTION),
683 errmsg(
"operator does not exist: %s", opr_name_or_oid)));
732 char *oprname =
NameStr(operform->oprname);
755 if (operform->oprleft)
763 if (operform->oprright)
816 elog(
ERROR,
"cache lookup failed for operator with OID %u",
825 if (oprForm->oprleft)
828 if (oprForm->oprright)
885 Node *escontext = fcinfo->context;
897 elog(
ERROR,
"regclass values must be OIDs in bootstrap mode");
913 errmsg(
"relation \"%s\" does not exist",
960 char *classname =
NameStr(classform->relname);
1029 Node *escontext = fcinfo->context;
1041 elog(
ERROR,
"regcollation values must be OIDs in bootstrap mode");
1055 (
errcode(ERRCODE_UNDEFINED_OBJECT),
1056 errmsg(
"collation \"%s\" for encoding \"%s\" does not exist",
1076 (
Node *) &escontext,
1103 char *collationname =
NameStr(collationform->collname);
1111 result =
pstrdup(collationname);
1179 Node *escontext = fcinfo->context;
1191 elog(
ERROR,
"regtype values must be OIDs in bootstrap mode");
1217 (
Node *) &escontext,
1324 Node *escontext = fcinfo->context;
1334 elog(
ERROR,
"regconfig values must be OIDs in bootstrap mode");
1348 (
errcode(ERRCODE_UNDEFINED_OBJECT),
1349 errmsg(
"text search configuration \"%s\" does not exist",
1376 char *cfgname =
NameStr(cfgform->cfgname);
1434 Node *escontext = fcinfo->context;
1444 elog(
ERROR,
"regdictionary values must be OIDs in bootstrap mode");
1458 (
errcode(ERRCODE_UNDEFINED_OBJECT),
1459 errmsg(
"text search dictionary \"%s\" does not exist",
1486 char *dictname =
NameStr(dictform->dictname);
1544 Node *escontext = fcinfo->context;
1554 elog(
ERROR,
"regrole values must be OIDs in bootstrap mode");
1563 (
errcode(ERRCODE_INVALID_NAME),
1564 errmsg(
"invalid name syntax")));
1570 (
errcode(ERRCODE_UNDEFINED_OBJECT),
1571 errmsg(
"role \"%s\" does not exist",
1591 (
Node *) &escontext,
1661 Node *escontext = fcinfo->context;
1671 elog(
ERROR,
"regnamespace values must be OIDs in bootstrap mode");
1680 (
errcode(ERRCODE_INVALID_NAME),
1681 errmsg(
"invalid name syntax")));
1687 (
errcode(ERRCODE_UNDEFINED_SCHEMA),
1688 errmsg(
"schema \"%s\" does not exist",
1708 (
Node *) &escontext,
1809 (
errcode(ERRCODE_INVALID_NAME),
1810 errmsg(
"invalid name syntax")));
1812 if (namelist ==
NIL)
1814 (
errcode(ERRCODE_INVALID_NAME),
1815 errmsg(
"invalid name syntax")));
1817 foreach(l, namelist)
1819 char *curname = (
char *)
lfirst(l);
1845 if (
string[0] >=
'0' &&
string[0] <=
'9' &&
1846 strspn(
string,
"0123456789") == strlen(
string))
1871 if (strcmp(
string,
"-") == 0)
1896 int *nargs,
Oid *argtypes,
1914 for (ptr = rawname; *ptr; ptr++)
1917 in_quote = !in_quote;
1918 else if (*ptr ==
'(' && !in_quote)
1923 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
1924 errmsg(
"expected a left parenthesis")));
1933 ptr2 = ptr + strlen(ptr);
1934 while (--ptr2 > ptr)
1941 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
1942 errmsg(
"expected a right parenthesis")));
1960 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
1961 errmsg(
"expected a type name")));
1972 in_quote = !in_quote;
1973 else if (*ptr ==
',' && !in_quote && paren_count == 0)
1990 if (in_quote || paren_count != 0)
1992 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
1993 errmsg(
"improper type name")));
2007 while (--ptr2 >=
typename)
2028 (
errcode(ERRCODE_TOO_MANY_ARGUMENTS),
2029 errmsg(
"too many arguments")));
2031 argtypes[*nargs] =
typeid;
Oid get_role_oid(const char *rolname, bool missing_ok)
#define Assert(condition)
#define OidIsValid(objectId)
int errhint(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereturn(context, dummy_value,...)
bool DirectInputFunctionCallSafe(PGFunction func, char *str, Oid typioparam, int32 typmod, fmNodePtr escontext, Datum *result)
#define PG_GETARG_TEXT_PP(n)
#define PG_RETURN_CSTRING(x)
#define PG_GETARG_CSTRING(n)
#define PG_RETURN_INT32(x)
#define PG_RETURN_DATUM(x)
#define HeapTupleIsValid(tuple)
List * lappend(List *list, void *datum)
void list_free(List *list)
char * get_namespace_name_or_temp(Oid nspid)
char * get_namespace_name(Oid nspid)
const char * GetDatabaseEncodingName(void)
char * pstrdup(const char *in)
void pfree(void *pointer)
#define IsBootstrapProcessingMode()
char * GetUserNameFromId(Oid roleid, bool noerr)
Oid OpernameGetOprid(List *names, Oid oprleft, Oid oprright)
char * NameListToString(const List *names)
bool CollationIsVisible(Oid collid)
Oid get_collation_oid(List *collname, bool missing_ok)
FuncCandidateList FuncnameGetCandidates(List *names, int nargs, List *argnames, bool expand_variadic, bool expand_defaults, bool include_out_arguments, bool missing_ok)
Oid get_namespace_oid(const char *nspname, bool missing_ok)
bool RelationIsVisible(Oid relid)
bool OperatorIsVisible(Oid oprid)
bool FunctionIsVisible(Oid funcid)
Oid get_ts_dict_oid(List *names, bool missing_ok)
RangeVar * makeRangeVarFromNameList(const List *names)
Oid get_ts_config_oid(List *names, bool missing_ok)
FuncCandidateList OpernameGetCandidates(List *names, char oprkind, bool missing_schema_ok)
bool TSConfigIsVisible(Oid cfgid)
bool TSDictionaryIsVisible(Oid dictId)
#define RangeVarGetRelid(relation, lockmode, missing_ok)
Datum oidrecv(PG_FUNCTION_ARGS)
Datum oidin(PG_FUNCTION_ARGS)
Datum oidsend(PG_FUNCTION_ARGS)
bool parseTypeString(const char *str, Oid *typeid_p, int32 *typmod_p, Node *escontext)
FormData_pg_class * Form_pg_class
FormData_pg_collation * Form_pg_collation
static int list_length(const List *l)
#define list_make2(x1, x2)
FormData_pg_operator * Form_pg_operator
FormData_pg_proc * Form_pg_proc
FormData_pg_ts_config * Form_pg_ts_config
FormData_pg_ts_dict * Form_pg_ts_dict
FormData_pg_type * Form_pg_type
#define ERRCODE_UNDEFINED_TABLE
int pg_strcasecmp(const char *s1, const char *s2)
static Oid DatumGetObjectId(Datum X)
static Datum ObjectIdGetDatum(Oid X)
static bool parseNameAndArgTypes(const char *string, bool allowNone, List **names, int *nargs, Oid *argtypes, Node *escontext)
Datum regtypesend(PG_FUNCTION_ARGS)
Datum regoperout(PG_FUNCTION_ARGS)
Datum regnamespacein(PG_FUNCTION_ARGS)
Datum regtypein(PG_FUNCTION_ARGS)
Datum regprocrecv(PG_FUNCTION_ARGS)
Datum to_regoperator(PG_FUNCTION_ARGS)
Datum regnamespaceout(PG_FUNCTION_ARGS)
char * format_operator_qualified(Oid operator_oid)
Datum regoperatorsend(PG_FUNCTION_ARGS)
char * format_procedure_extended(Oid procedure_oid, bits16 flags)
Datum regoperin(PG_FUNCTION_ARGS)
Datum regoperatorrecv(PG_FUNCTION_ARGS)
Datum regproceduresend(PG_FUNCTION_ARGS)
Datum regdictionarysend(PG_FUNCTION_ARGS)
Datum regprocout(PG_FUNCTION_ARGS)
Datum to_regoper(PG_FUNCTION_ARGS)
Datum to_regprocedure(PG_FUNCTION_ARGS)
char * format_procedure(Oid procedure_oid)
Datum regcollationrecv(PG_FUNCTION_ARGS)
Datum regcollationin(PG_FUNCTION_ARGS)
Datum regprocedureout(PG_FUNCTION_ARGS)
Datum regtyperecv(PG_FUNCTION_ARGS)
Datum regdictionaryrecv(PG_FUNCTION_ARGS)
Datum regrolerecv(PG_FUNCTION_ARGS)
Datum regclassrecv(PG_FUNCTION_ARGS)
static bool parseDashOrOid(char *string, Oid *result, Node *escontext)
Datum to_regrole(PG_FUNCTION_ARGS)
Datum regconfigrecv(PG_FUNCTION_ARGS)
Datum regdictionaryout(PG_FUNCTION_ARGS)
Datum regdictionaryin(PG_FUNCTION_ARGS)
Datum regoperatorout(PG_FUNCTION_ARGS)
Datum regcollationout(PG_FUNCTION_ARGS)
Datum regprocsend(PG_FUNCTION_ARGS)
Datum regoperatorin(PG_FUNCTION_ARGS)
Datum regconfigsend(PG_FUNCTION_ARGS)
Datum regclassin(PG_FUNCTION_ARGS)
Datum regconfigin(PG_FUNCTION_ARGS)
char * format_operator_extended(Oid operator_oid, bits16 flags)
List * stringToQualifiedNameList(const char *string, Node *escontext)
void format_operator_parts(Oid operator_oid, List **objnames, List **objargs, bool missing_ok)
Datum to_regcollation(PG_FUNCTION_ARGS)
Datum regconfigout(PG_FUNCTION_ARGS)
Datum to_regtype(PG_FUNCTION_ARGS)
Datum regroleout(PG_FUNCTION_ARGS)
Datum to_regclass(PG_FUNCTION_ARGS)
Datum regopersend(PG_FUNCTION_ARGS)
static bool parseNumericOid(char *string, Oid *result, Node *escontext)
Datum regoperrecv(PG_FUNCTION_ARGS)
Datum regnamespacesend(PG_FUNCTION_ARGS)
Datum regprocedurein(PG_FUNCTION_ARGS)
Datum regrolein(PG_FUNCTION_ARGS)
Datum regcollationsend(PG_FUNCTION_ARGS)
Datum to_regproc(PG_FUNCTION_ARGS)
Datum regprocin(PG_FUNCTION_ARGS)
Datum regrolesend(PG_FUNCTION_ARGS)
char * format_procedure_qualified(Oid procedure_oid)
Datum to_regnamespace(PG_FUNCTION_ARGS)
void format_procedure_parts(Oid procedure_oid, List **objnames, List **objargs, bool missing_ok)
Datum to_regtypemod(PG_FUNCTION_ARGS)
Datum regclasssend(PG_FUNCTION_ARGS)
Datum regtypeout(PG_FUNCTION_ARGS)
char * format_operator(Oid operator_oid)
Datum text_regclass(PG_FUNCTION_ARGS)
Datum regprocedurerecv(PG_FUNCTION_ARGS)
Datum regnamespacerecv(PG_FUNCTION_ARGS)
Datum regclassout(PG_FUNCTION_ARGS)
#define FORMAT_OPERATOR_INVALID_AS_NULL
#define FORMAT_OPERATOR_FORCE_QUALIFY
#define FORMAT_PROC_FORCE_QUALIFY
#define FORMAT_PROC_INVALID_AS_NULL
char * quote_qualified_identifier(const char *qualifier, const char *ident)
const char * quote_identifier(const char *ident)
bool scanner_isspace(char ch)
void appendStringInfo(StringInfo str, const char *fmt,...)
void appendStringInfoString(StringInfo str, const char *s)
void appendStringInfoChar(StringInfo str, char ch)
void initStringInfo(StringInfo str)
struct _FuncCandidateList * next
Oid args[FLEXIBLE_ARRAY_MEMBER]
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
String * makeString(char *str)
bool SplitIdentifierString(char *rawstring, char separator, List **namelist)
char * text_to_cstring(const text *t)
List * textToQualifiedNameList(text *textval)