45 List **names,
int *nargs,
Oid *argtypes);
69 if (strcmp(pro_name_or_oid,
"-") == 0)
73 if (pro_name_or_oid[0] >=
'0' &&
74 pro_name_or_oid[0] <=
'9' &&
75 strspn(pro_name_or_oid,
"0123456789") == strlen(pro_name_or_oid))
89 elog(
ERROR,
"regproc values must be OIDs in bootstrap mode");
100 (
errcode(ERRCODE_UNDEFINED_FUNCTION),
101 errmsg(
"function \"%s\" does not exist", pro_name_or_oid)));
102 else if (clist->
next != NULL)
104 (
errcode(ERRCODE_AMBIGUOUS_FUNCTION),
105 errmsg(
"more than one function named \"%s\"",
132 if (clist == NULL || clist->
next != NULL)
178 -1,
NIL,
false,
false,
false);
179 if (clist != NULL && clist->
next == NULL &&
240 if (strcmp(pro_name_or_oid,
"-") == 0)
244 if (pro_name_or_oid[0] >=
'0' &&
245 pro_name_or_oid[0] <=
'9' &&
246 strspn(pro_name_or_oid,
"0123456789") == strlen(pro_name_or_oid))
255 elog(
ERROR,
"regprocedure values must be OIDs in bootstrap mode");
267 for (; clist; clist = clist->
next)
269 if (memcmp(clist->
args, argtypes, nargs *
sizeof(
Oid)) == 0)
275 (
errcode(ERRCODE_UNDEFINED_FUNCTION),
276 errmsg(
"function \"%s\" does not exist", pro_name_or_oid)));
306 for (; clist; clist = clist->
next)
308 if (memcmp(clist->
args, argtypes, nargs *
sizeof(
Oid)) == 0)
360 int nargs = procform->pronargs;
382 for (i = 0; i < nargs; i++)
384 Oid thisargtype = procform->proargtypes.values[
i];
389 (flags & FORMAT_PROC_FORCE_QUALIFY) != 0 ?
434 elog(
ERROR,
"cache lookup failed for procedure with OID %u", procedure_oid);
439 nargs = procform->pronargs;
444 for (i = 0; i < nargs; i++)
446 Oid thisargtype = procform->proargtypes.values[
i];
509 if (strcmp(opr_name_or_oid,
"0") == 0)
513 if (opr_name_or_oid[0] >=
'0' &&
514 opr_name_or_oid[0] <=
'9' &&
515 strspn(opr_name_or_oid,
"0123456789") == strlen(opr_name_or_oid))
526 elog(
ERROR,
"regoper values must be OIDs in bootstrap mode");
537 (
errcode(ERRCODE_UNDEFINED_FUNCTION),
538 errmsg(
"operator does not exist: %s", opr_name_or_oid)));
539 else if (clist->
next != NULL)
541 (
errcode(ERRCODE_AMBIGUOUS_FUNCTION),
542 errmsg(
"more than one operator named %s",
569 if (clist == NULL || clist->
next != NULL)
596 char *oprname =
NameStr(operform->oprname);
615 if (clist != NULL && clist->
next == NULL &&
624 result = (
char *)
palloc(strlen(nspname) + strlen(oprname) + 2);
625 sprintf(result,
"%s.%s", nspname, oprname);
682 if (strcmp(opr_name_or_oid,
"0") == 0)
686 if (opr_name_or_oid[0] >=
'0' &&
687 opr_name_or_oid[0] <=
'9' &&
688 strspn(opr_name_or_oid,
"0123456789") == strlen(opr_name_or_oid))
697 elog(
ERROR,
"regoperator values must be OIDs in bootstrap mode");
708 (
errcode(ERRCODE_UNDEFINED_PARAMETER),
709 errmsg(
"missing argument"),
710 errhint(
"Use NONE to denote the missing argument of a unary operator.")));
713 (
errcode(ERRCODE_TOO_MANY_ARGUMENTS),
714 errmsg(
"too many arguments"),
715 errhint(
"Provide two argument types for operator.")));
721 (
errcode(ERRCODE_UNDEFINED_FUNCTION),
722 errmsg(
"operator does not exist: %s", opr_name_or_oid)));
749 (
errcode(ERRCODE_UNDEFINED_PARAMETER),
750 errmsg(
"missing argument"),
751 errhint(
"Use NONE to denote the missing argument of a unary operator.")));
754 (
errcode(ERRCODE_TOO_MANY_ARGUMENTS),
755 errmsg(
"too many arguments"),
756 errhint(
"Provide two argument types for operator.")));
790 char *oprname =
NameStr(operform->oprname);
813 if (operform->oprleft)
815 (flags & FORMAT_OPERATOR_FORCE_QUALIFY) != 0 ?
821 if (operform->oprright)
823 (flags & FORMAT_OPERATOR_FORCE_QUALIFY) != 0 ?
874 elog(
ERROR,
"cache lookup failed for operator with OID %u",
883 if (oprForm->oprleft)
886 if (oprForm->oprright)
947 if (strcmp(class_name_or_oid,
"-") == 0)
951 if (class_name_or_oid[0] >=
'0' &&
952 class_name_or_oid[0] <=
'9' &&
953 strspn(class_name_or_oid,
"0123456789") == strlen(class_name_or_oid))
964 elog(
ERROR,
"regclass values must be OIDs in bootstrap mode");
1026 char *classname =
NameStr(classform->relname);
1099 if (strcmp(collation_name_or_oid,
"-") == 0)
1103 if (collation_name_or_oid[0] >=
'0' &&
1104 collation_name_or_oid[0] <=
'9' &&
1105 strspn(collation_name_or_oid,
"0123456789") == strlen(collation_name_or_oid))
1116 elog(
ERROR,
"regcollation values must be OIDs in bootstrap mode");
1177 char *collationname =
NameStr(collationform->collname);
1185 result =
pstrdup(collationname);
1257 if (strcmp(typ_name_or_oid,
"-") == 0)
1261 if (typ_name_or_oid[0] >=
'0' &&
1262 typ_name_or_oid[0] <=
'9' &&
1263 strspn(typ_name_or_oid,
"0123456789") == strlen(typ_name_or_oid))
1274 elog(
ERROR,
"regtype values must be OIDs in bootstrap mode");
1393 if (strcmp(cfg_name_or_oid,
"-") == 0)
1397 if (cfg_name_or_oid[0] >=
'0' &&
1398 cfg_name_or_oid[0] <=
'9' &&
1399 strspn(cfg_name_or_oid,
"0123456789") == strlen(cfg_name_or_oid))
1408 elog(
ERROR,
"regconfig values must be OIDs in bootstrap mode");
1442 char *cfgname =
NameStr(cfgform->cfgname);
1504 if (strcmp(dict_name_or_oid,
"-") == 0)
1508 if (dict_name_or_oid[0] >=
'0' &&
1509 dict_name_or_oid[0] <=
'9' &&
1510 strspn(dict_name_or_oid,
"0123456789") == strlen(dict_name_or_oid))
1519 elog(
ERROR,
"regdictionary values must be OIDs in bootstrap mode");
1553 char *dictname =
NameStr(dictform->dictname);
1615 if (strcmp(role_name_or_oid,
"-") == 0)
1619 if (role_name_or_oid[0] >=
'0' &&
1620 role_name_or_oid[0] <=
'9' &&
1621 strspn(role_name_or_oid,
"0123456789") == strlen(role_name_or_oid))
1630 elog(
ERROR,
"regrole values must be OIDs in bootstrap mode");
1637 (
errcode(ERRCODE_INVALID_NAME),
1638 errmsg(
"invalid name syntax")));
1661 (
errcode(ERRCODE_INVALID_NAME),
1662 errmsg(
"invalid name syntax")));
1740 if (strcmp(nsp_name_or_oid,
"-") == 0)
1744 if (nsp_name_or_oid[0] >=
'0' &&
1745 nsp_name_or_oid[0] <=
'9' &&
1746 strspn(nsp_name_or_oid,
"0123456789") == strlen(nsp_name_or_oid))
1755 elog(
ERROR,
"regnamespace values must be OIDs in bootstrap mode");
1762 (
errcode(ERRCODE_INVALID_NAME),
1763 errmsg(
"invalid name syntax")));
1786 (
errcode(ERRCODE_INVALID_NAME),
1787 errmsg(
"invalid name syntax")));
1888 (
errcode(ERRCODE_INVALID_NAME),
1889 errmsg(
"invalid name syntax")));
1891 if (namelist ==
NIL)
1893 (
errcode(ERRCODE_INVALID_NAME),
1894 errmsg(
"invalid name syntax")));
1896 foreach(l, namelist)
1898 char *curname = (
char *)
lfirst(l);
1925 int *nargs,
Oid *argtypes)
1942 for (ptr = rawname; *ptr; ptr++)
1945 in_quote = !in_quote;
1946 else if (*ptr ==
'(' && !in_quote)
1951 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
1952 errmsg(
"expected a left parenthesis")));
1959 ptr2 = ptr + strlen(ptr);
1960 while (--ptr2 > ptr)
1967 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
1968 errmsg(
"expected a right parenthesis")));
1986 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
1987 errmsg(
"expected a type name")));
1998 in_quote = !in_quote;
1999 else if (*ptr ==
',' && !in_quote && paren_count == 0)
2016 if (in_quote || paren_count != 0)
2018 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
2019 errmsg(
"improper type name")));
2033 while (--ptr2 >=
typename)
2053 (
errcode(ERRCODE_TOO_MANY_ARGUMENTS),
2054 errmsg(
"too many arguments")));
2056 argtypes[*nargs] =
typeid;
#define list_make2(x1, x2)
Value * makeString(char *str)
Datum regoperatorrecv(PG_FUNCTION_ARGS)
Datum regnamespaceout(PG_FUNCTION_ARGS)
Datum regoperatorin(PG_FUNCTION_ARGS)
Datum regconfigsend(PG_FUNCTION_ARGS)
Oid get_namespace_oid(const char *nspname, bool missing_ok)
int errhint(const char *fmt,...)
Datum regclassin(PG_FUNCTION_ARGS)
Datum regcollationin(PG_FUNCTION_ARGS)
const char * quote_identifier(const char *ident)
FormData_pg_ts_config * Form_pg_ts_config
Datum regroleout(PG_FUNCTION_ARGS)
Datum regrolesend(PG_FUNCTION_ARGS)
#define RangeVarGetRelid(relation, lockmode, missing_ok)
Datum regoperout(PG_FUNCTION_ARGS)
Datum regdictionaryout(PG_FUNCTION_ARGS)
#define DatumGetObjectId(X)
char * pstrdup(const char *in)
Datum to_regrole(PG_FUNCTION_ARGS)
Datum to_regcollation(PG_FUNCTION_ARGS)
Datum regoperin(PG_FUNCTION_ARGS)
int errcode(int sqlerrcode)
Oid get_ts_config_oid(List *names, bool missing_ok)
Datum regrolerecv(PG_FUNCTION_ARGS)
bool OperatorIsVisible(Oid oprid)
char * format_operator(Oid operator_oid)
Datum to_regoper(PG_FUNCTION_ARGS)
bool FunctionIsVisible(Oid funcid)
RangeVar * makeRangeVarFromNameList(List *names)
Datum regtypeout(PG_FUNCTION_ARGS)
#define DirectFunctionCall1(func, arg1)
int pg_strcasecmp(const char *s1, const char *s2)
Datum regopersend(PG_FUNCTION_ARGS)
#define OidIsValid(objectId)
Datum regtyperecv(PG_FUNCTION_ARGS)
Datum regprocin(PG_FUNCTION_ARGS)
char * format_operator_extended(Oid operator_oid, bits16 flags)
FuncCandidateList OpernameGetCandidates(List *names, char oprkind, bool missing_schema_ok)
Datum oidsend(PG_FUNCTION_ARGS)
#define PG_GETARG_TEXT_PP(n)
Oid get_role_oid(const char *rolname, bool missing_ok)
Datum regconfigout(PG_FUNCTION_ARGS)
Datum text_regclass(PG_FUNCTION_ARGS)
Datum regprocedureout(PG_FUNCTION_ARGS)
Datum oidrecv(PG_FUNCTION_ARGS)
Oid OpernameGetOprid(List *names, Oid oprleft, Oid oprright)
Oid get_ts_dict_oid(List *names, bool missing_ok)
Oid args[FLEXIBLE_ARRAY_MEMBER]
void pfree(void *pointer)
void appendStringInfo(StringInfo str, const char *fmt,...)
#define ObjectIdGetDatum(X)
Datum regprocedurein(PG_FUNCTION_ARGS)
bool TSConfigIsVisible(Oid cfgid)
FuncCandidateList FuncnameGetCandidates(List *names, int nargs, List *argnames, bool expand_variadic, bool expand_defaults, bool missing_ok)
Datum regproceduresend(PG_FUNCTION_ARGS)
char * format_operator_qualified(Oid operator_oid)
Datum to_regprocedure(PG_FUNCTION_ARGS)
Datum regprocout(PG_FUNCTION_ARGS)
FormData_pg_ts_dict * Form_pg_ts_dict
void appendStringInfoString(StringInfo str, const char *s)
Datum regtypesend(PG_FUNCTION_ARGS)
Datum to_regproc(PG_FUNCTION_ARGS)
char * get_namespace_name(Oid nspid)
bool SplitIdentifierString(char *rawstring, char separator, List **namelist)
Datum regclasssend(PG_FUNCTION_ARGS)
#define CStringGetDatum(X)
Datum regrolein(PG_FUNCTION_ARGS)
Datum regprocrecv(PG_FUNCTION_ARGS)
bool CollationIsVisible(Oid collid)
Datum regdictionarysend(PG_FUNCTION_ARGS)
Datum regprocsend(PG_FUNCTION_ARGS)
struct _FuncCandidateList * next
char * format_procedure_qualified(Oid procedure_oid)
Datum to_regtype(PG_FUNCTION_ARGS)
List * textToQualifiedNameList(text *textval)
List * lappend(List *list, void *datum)
Datum regcollationout(PG_FUNCTION_ARGS)
void appendStringInfoChar(StringInfo str, char ch)
void initStringInfo(StringInfo str)
bool TSDictionaryIsVisible(Oid dictId)
char * quote_qualified_identifier(const char *qualifier, const char *ident)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
Datum regtypein(PG_FUNCTION_ARGS)
#define FORMAT_OPERATOR_INVALID_AS_NULL
void ReleaseSysCache(HeapTuple tuple)
char * format_procedure_extended(Oid procedure_oid, bits16 flags)
bool scanner_isspace(char ch)
FormData_pg_proc * Form_pg_proc
void parseTypeString(const char *str, Oid *typeid_p, int32 *typmod_p, bool missing_ok)
void format_procedure_parts(Oid procedure_oid, List **objnames, List **objargs, bool missing_ok)
#define ereport(elevel,...)
char * format_procedure(Oid procedure_oid)
#define FORMAT_PROC_INVALID_AS_NULL
#define HeapTupleIsValid(tuple)
char * GetUserNameFromId(Oid roleid, bool noerr)
#define Assert(condition)
static void parseNameAndArgTypes(const char *string, bool allowNone, List **names, int *nargs, Oid *argtypes)
Datum regclassout(PG_FUNCTION_ARGS)
#define PG_RETURN_CSTRING(x)
FormData_pg_type * Form_pg_type
static int list_length(const List *l)
Datum regnamespacesend(PG_FUNCTION_ARGS)
Datum to_regnamespace(PG_FUNCTION_ARGS)
FormData_pg_operator * Form_pg_operator
Datum regprocedurerecv(PG_FUNCTION_ARGS)
FormData_pg_collation * Form_pg_collation
#define IsBootstrapProcessingMode()
FormData_pg_class * Form_pg_class
char * text_to_cstring(const text *t)
#define FORMAT_PROC_FORCE_QUALIFY
List * stringToQualifiedNameList(const char *string)
Datum regdictionaryin(PG_FUNCTION_ARGS)
Datum regnamespacerecv(PG_FUNCTION_ARGS)
void format_operator_parts(Oid operator_oid, List **objnames, List **objargs, bool missing_ok)
int errmsg(const char *fmt,...)
bool RelationIsVisible(Oid relid)
char * get_namespace_name_or_temp(Oid nspid)
void list_free(List *list)
Datum regoperatorout(PG_FUNCTION_ARGS)
Datum to_regoperator(PG_FUNCTION_ARGS)
#define PG_GETARG_CSTRING(n)
Datum oidin(PG_FUNCTION_ARGS)
Datum regconfigrecv(PG_FUNCTION_ARGS)
Datum regdictionaryrecv(PG_FUNCTION_ARGS)
Datum regoperrecv(PG_FUNCTION_ARGS)
Datum regnamespacein(PG_FUNCTION_ARGS)
Datum regconfigin(PG_FUNCTION_ARGS)
Datum regcollationsend(PG_FUNCTION_ARGS)
Oid get_collation_oid(List *name, bool missing_ok)
Datum regoperatorsend(PG_FUNCTION_ARGS)
#define FORMAT_OPERATOR_FORCE_QUALIFY
Datum to_regclass(PG_FUNCTION_ARGS)
Datum regcollationrecv(PG_FUNCTION_ARGS)
Datum regclassrecv(PG_FUNCTION_ARGS)