50 List **names,
int *nargs,
Oid *argtypes,
70 Node *escontext = fcinfo->context;
87 elog(
ERROR,
"regproc values must be OIDs in bootstrap mode");
102 (
errcode(ERRCODE_UNDEFINED_FUNCTION),
103 errmsg(
"function \"%s\" does not exist", pro_name_or_oid)));
104 else if (clist->
next != NULL)
106 (
errcode(ERRCODE_AMBIGUOUS_FUNCTION),
107 errmsg(
"more than one function named \"%s\"",
176 -1,
NIL,
false,
false,
false,
false,
178 if (clist != NULL && clist->
next == NULL &&
232 Node *escontext = fcinfo->context;
246 elog(
ERROR,
"regprocedure values must be OIDs in bootstrap mode");
255 &names, &nargs, argtypes,
262 for (; clist; clist = clist->
next)
264 if (memcmp(clist->
args, argtypes, nargs *
sizeof(
Oid)) == 0)
270 (
errcode(ERRCODE_UNDEFINED_FUNCTION),
271 errmsg(
"function \"%s\" does not exist", pro_name_or_oid)));
343 int nargs = procform->pronargs;
365 for (
i = 0;
i < nargs;
i++)
367 Oid thisargtype = procform->proargtypes.values[
i];
417 elog(
ERROR,
"cache lookup failed for procedure with OID %u", procedure_oid);
422 nargs = procform->pronargs;
427 for (
i = 0;
i < nargs;
i++)
429 Oid thisargtype = procform->proargtypes.values[
i];
487 Node *escontext = fcinfo->context;
501 elog(
ERROR,
"regoper values must be OIDs in bootstrap mode");
515 (
errcode(ERRCODE_UNDEFINED_FUNCTION),
516 errmsg(
"operator does not exist: %s", opr_name_or_oid)));
517 else if (clist->
next != NULL)
519 (
errcode(ERRCODE_AMBIGUOUS_FUNCTION),
520 errmsg(
"more than one operator named %s",
569 char *oprname =
NameStr(operform->oprname);
588 '\0',
false, &fgc_flags);
589 if (clist != NULL && clist->
next == NULL &&
598 result = (
char *)
palloc(strlen(nspname) + strlen(oprname) + 2);
599 sprintf(result,
"%s.%s", nspname, oprname);
650 Node *escontext = fcinfo->context;
662 elog(
ERROR,
"regoperator values must be OIDs in bootstrap mode");
671 &names, &nargs, argtypes,
677 (
errcode(ERRCODE_UNDEFINED_PARAMETER),
678 errmsg(
"missing argument"),
679 errhint(
"Use NONE to denote the missing argument of a unary operator.")));
682 (
errcode(ERRCODE_TOO_MANY_ARGUMENTS),
683 errmsg(
"too many arguments"),
684 errhint(
"Provide two argument types for operator.")));
690 (
errcode(ERRCODE_UNDEFINED_FUNCTION),
691 errmsg(
"operator does not exist: %s", opr_name_or_oid)));
740 char *oprname =
NameStr(operform->oprname);
763 if (operform->oprleft)
771 if (operform->oprright)
824 elog(
ERROR,
"cache lookup failed for operator with OID %u",
833 if (oprForm->oprleft)
836 if (oprForm->oprright)
893 Node *escontext = fcinfo->context;
905 elog(
ERROR,
"regclass values must be OIDs in bootstrap mode");
921 errmsg(
"relation \"%s\" does not exist",
968 char *classname =
NameStr(classform->relname);
1037 Node *escontext = fcinfo->context;
1049 elog(
ERROR,
"regcollation values must be OIDs in bootstrap mode");
1063 (
errcode(ERRCODE_UNDEFINED_OBJECT),
1064 errmsg(
"collation \"%s\" for encoding \"%s\" does not exist",
1084 (
Node *) &escontext,
1111 char *collationname =
NameStr(collationform->collname);
1119 result =
pstrdup(collationname);
1187 Node *escontext = fcinfo->context;
1199 elog(
ERROR,
"regtype values must be OIDs in bootstrap mode");
1225 (
Node *) &escontext,
1332 Node *escontext = fcinfo->context;
1342 elog(
ERROR,
"regconfig values must be OIDs in bootstrap mode");
1356 (
errcode(ERRCODE_UNDEFINED_OBJECT),
1357 errmsg(
"text search configuration \"%s\" does not exist",
1384 char *cfgname =
NameStr(cfgform->cfgname);
1442 Node *escontext = fcinfo->context;
1452 elog(
ERROR,
"regdictionary values must be OIDs in bootstrap mode");
1466 (
errcode(ERRCODE_UNDEFINED_OBJECT),
1467 errmsg(
"text search dictionary \"%s\" does not exist",
1494 char *dictname =
NameStr(dictform->dictname);
1552 Node *escontext = fcinfo->context;
1562 elog(
ERROR,
"regrole values must be OIDs in bootstrap mode");
1571 (
errcode(ERRCODE_INVALID_NAME),
1572 errmsg(
"invalid name syntax")));
1578 (
errcode(ERRCODE_UNDEFINED_OBJECT),
1579 errmsg(
"role \"%s\" does not exist",
1599 (
Node *) &escontext,
1669 Node *escontext = fcinfo->context;
1679 elog(
ERROR,
"regnamespace values must be OIDs in bootstrap mode");
1688 (
errcode(ERRCODE_INVALID_NAME),
1689 errmsg(
"invalid name syntax")));
1695 (
errcode(ERRCODE_UNDEFINED_SCHEMA),
1696 errmsg(
"schema \"%s\" does not exist",
1716 (
Node *) &escontext,
1786 Node *escontext = fcinfo->context;
1796 elog(
ERROR,
"regdatabase values must be OIDs in bootstrap mode");
1805 (
errcode(ERRCODE_INVALID_NAME),
1806 errmsg(
"invalid name syntax")));
1812 (
errcode(ERRCODE_UNDEFINED_OBJECT),
1813 errmsg(
"database \"%s\" does not exist",
1833 (
Node *) &escontext,
1934 (
errcode(ERRCODE_INVALID_NAME),
1935 errmsg(
"invalid name syntax")));
1937 if (namelist ==
NIL)
1939 (
errcode(ERRCODE_INVALID_NAME),
1940 errmsg(
"invalid name syntax")));
1942 foreach(l, namelist)
1944 char *curname = (
char *)
lfirst(l);
1970 if (
string[0] >=
'0' &&
string[0] <=
'9' &&
1971 strspn(
string,
"0123456789") == strlen(
string))
1996 if (strcmp(
string,
"-") == 0)
2021 int *nargs,
Oid *argtypes,
2039 for (ptr = rawname; *ptr; ptr++)
2042 in_quote = !in_quote;
2043 else if (*ptr ==
'(' && !in_quote)
2048 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
2049 errmsg(
"expected a left parenthesis")));
2058 ptr2 = ptr + strlen(ptr);
2059 while (--ptr2 > ptr)
2066 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
2067 errmsg(
"expected a right parenthesis")));
2085 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
2086 errmsg(
"expected a type name")));
2097 in_quote = !in_quote;
2098 else if (*ptr ==
',' && !in_quote && paren_count == 0)
2115 if (in_quote || paren_count != 0)
2117 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
2118 errmsg(
"improper type name")));
2132 while (--ptr2 >=
typename)
2153 (
errcode(ERRCODE_TOO_MANY_ARGUMENTS),
2154 errmsg(
"too many arguments")));
2156 argtypes[*nargs] =
typeid;
Oid get_role_oid(const char *rolname, bool missing_ok)
#define OidIsValid(objectId)
Oid get_database_oid(const char *dbname, bool missing_ok)
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, Node *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)
Assert(PointerIsAligned(start, uint64))
#define HeapTupleIsValid(tuple)
static void * GETSTRUCT(const HeapTupleData *tuple)
List * lappend(List *list, void *datum)
void list_free(List *list)
char * get_database_name(Oid dbid)
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 OpernameGetCandidates(List *names, char oprkind, bool missing_schema_ok, int *fgc_flags)
Oid get_namespace_oid(const char *nspname, bool missing_ok)
bool RelationIsVisible(Oid relid)
bool OperatorIsVisible(Oid oprid)
FuncCandidateList FuncnameGetCandidates(List *names, int nargs, List *argnames, bool expand_variadic, bool expand_defaults, bool include_out_arguments, bool missing_ok, int *fgc_flags)
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)
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 regdatabasesend(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 regdatabaserecv(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 to_regdatabase(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 regdatabaseout(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 regdatabasein(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)