1/*-------------------------------------------------------------------------
4 * Functions for the built-in types regproc, regclass, regtype, etc.
6 * These types are all binary-compatible with type Oid, and rely on Oid
7 * for comparison and so forth. Their only interesting behavior is in
8 * special I/O conversion routines.
11 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
12 * Portions Copyright (c) 1994, Regents of the University of California
16 * src/backend/utils/adt/regproc.c
18 *-------------------------------------------------------------------------
50 List **names,
int *nargs,
Oid *argtypes,
54/*****************************************************************************
56 *****************************************************************************/
59 * regprocin - converts "proname" to proc OID
61 * We also accept a numeric OID, for symmetry with the output routine.
63 * '-' signifies unknown (OID 0). In all other cases, the input must
64 * match an existing pg_proc entry.
70 Node *escontext = fcinfo->context;
76 /* Handle "-" or numeric OID */
80 /* Else it's a name, possibly schema-qualified */
83 * We should never get here in bootstrap mode, as all references should
84 * have been resolved by genbki.pl.
87 elog(
ERROR,
"regproc values must be OIDs in bootstrap mode");
90 * Normal case: parse the name into components and see if it matches any
91 * pg_proc entries in the current search path.
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\"",
116 * to_regproc - converts "proname" to proc OID
118 * If the name is not found, we return NULL.
136 * regprocout - converts proc OID to "pro_name"
159 * In bootstrap mode, skip the fancy namespace stuff and just return
160 * the proc name. (This path is only needed for debugging output
172 * Would this proc be found (uniquely!) by regprocin? If not,
176 -1,
NIL,
false,
false,
false,
false,
178 if (clist != NULL && clist->
next == NULL &&
191 /* If OID doesn't match any pg_proc entry, return it numerically */
200 * regprocrecv - converts external binary format to regproc
205 /* Exactly the same as oidrecv, so share code */
210 * regprocsend - converts regproc to binary format
215 /* Exactly the same as oidsend, so share code */
221 * regprocedurein - converts "proname(args)" to proc OID
223 * We also accept a numeric OID, for symmetry with the output routine.
225 * '-' signifies unknown (OID 0). In all other cases, the input must
226 * match an existing pg_proc entry.
232 Node *escontext = fcinfo->context;
240 /* Handle "-" or numeric OID */
244 /* The rest of this wouldn't work in bootstrap mode */
246 elog(
ERROR,
"regprocedure values must be OIDs in bootstrap mode");
249 * Else it's a name and arguments. Parse the name and arguments, look up
250 * potential matches in the current namespace search list, and scan to see
251 * which one exactly matches the given argument types. (There will not be
252 * more than one match.)
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)));
279 * to_regprocedure - converts "proname(args)" to proc OID
281 * If the name is not found, we return NULL.
299 * format_procedure - converts proc OID to "pro_name(args)"
301 * This exports the useful functionality of regprocedureout for use
302 * in other backend modules. The result is a palloc'd string.
317 * format_procedure_extended - converts procedure OID to "pro_name(args)"
319 * This exports the useful functionality of regprocedureout for use
320 * in other backend modules. The result is a palloc'd string, or NULL.
322 * Routine to produce regprocedure names; see format_procedure above.
324 * The following bits in 'flags' modify the behavior:
325 * - FORMAT_PROC_INVALID_AS_NULL
326 * if the procedure OID is invalid or unknown, return NULL instead
327 * of the numeric OID.
328 * - FORMAT_PROC_FORCE_QUALIFY
329 * always schema-qualify procedure names, regardless of search_path
343 int nargs = procform->pronargs;
348 /* XXX no support here for bootstrap mode */
354 * Would this proc be found (given the right args) by regprocedurein?
355 * If not, or if caller requests it, we need to qualify it.
365 for (
i = 0;
i < nargs;
i++)
367 Oid thisargtype = procform->proargtypes.values[
i];
384 /* If object is undefined, return NULL as wanted by caller */
389 /* If OID doesn't match any pg_proc entry, return it numerically */
398 * Output an objname/objargs representation for the procedure with the
399 * given OID. If it doesn't exist, an error is thrown.
401 * This can be used to feed get_object_address.
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];
438 * regprocedureout - converts proc OID to "pro_name(args)"
455 * regprocedurerecv - converts external binary format to regprocedure
460 /* Exactly the same as oidrecv, so share code */
465 * regproceduresend - converts regprocedure to binary format
470 /* Exactly the same as oidsend, so share code */
476 * regoperin - converts "oprname" to operator OID
478 * We also accept a numeric OID, for symmetry with the output routine.
480 * '0' signifies unknown (OID 0). In all other cases, the input must
481 * match an existing pg_operator entry.
487 Node *escontext = fcinfo->context;
493 /* Handle "0" or numeric OID */
497 /* Else it's a name, possibly schema-qualified */
499 /* The rest of this wouldn't work in bootstrap mode */
501 elog(
ERROR,
"regoper values must be OIDs in bootstrap mode");
504 * Normal case: parse the name into components and see if it matches any
505 * pg_operator entries in the current search path.
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",
529 * to_regoper - converts "oprname" to operator OID
531 * If the name is not found, we return NULL.
549 * regoperout - converts operator OID to "opr_name"
569 char *oprname =
NameStr(operform->oprname);
572 * In bootstrap mode, skip the fancy namespace stuff and just return
573 * the oper name. (This path is only needed for debugging output
584 * Would this oper be found (uniquely!) by regoperin? If not,
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);
608 * If OID doesn't match any pg_operator entry, return it numerically
618 * regoperrecv - converts external binary format to regoper
623 /* Exactly the same as oidrecv, so share code */
628 * regopersend - converts regoper to binary format
633 /* Exactly the same as oidsend, so share code */
639 * regoperatorin - converts "oprname(args)" to operator OID
641 * We also accept a numeric OID, for symmetry with the output routine.
643 * '0' signifies unknown (OID 0). In all other cases, the input must
644 * match an existing pg_operator entry.
650 Node *escontext = fcinfo->context;
656 /* Handle "0" or numeric OID */
660 /* The rest of this wouldn't work in bootstrap mode */
662 elog(
ERROR,
"regoperator values must be OIDs in bootstrap mode");
665 * Else it's a name and arguments. Parse the name and arguments, look up
666 * potential matches in the current namespace search list, and scan to see
667 * which one exactly matches the given argument types. (There will not be
668 * more than one match.)
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)));
697 * to_regoperator - converts "oprname(args)" to operator OID
699 * If the name is not found, we return NULL.
717 * format_operator_extended - converts operator OID to "opr_name(args)"
719 * This exports the useful functionality of regoperatorout for use
720 * in other backend modules. The result is a palloc'd string, or NULL.
722 * The following bits in 'flags' modify the behavior:
723 * - FORMAT_OPERATOR_INVALID_AS_NULL
724 * if the operator OID is invalid or unknown, return NULL instead
725 * of the numeric OID.
726 * - FORMAT_OPERATOR_FORCE_QUALIFY
727 * always schema-qualify operator names, regardless of search_path
740 char *oprname =
NameStr(operform->oprname);
744 /* XXX no support here for bootstrap mode */
750 * Would this oper be found (given the right args) by regoperatorin?
751 * If not, or if caller explicitly requests it, we need to qualify it.
763 if (operform->oprleft)
771 if (operform->oprright)
785 /* If object is undefined, return NULL as wanted by caller */
791 * If OID doesn't match any pg_operator entry, return it numerically
824 elog(
ERROR,
"cache lookup failed for operator with OID %u",
833 if (oprForm->oprleft)
836 if (oprForm->oprright)
844 * regoperatorout - converts operator OID to "opr_name(args)"
861 * regoperatorrecv - converts external binary format to regoperator
866 /* Exactly the same as oidrecv, so share code */
871 * regoperatorsend - converts regoperator to binary format
876 /* Exactly the same as oidsend, so share code */
882 * regclassin - converts "classname" to class OID
884 * We also accept a numeric OID, for symmetry with the output routine.
886 * '-' signifies unknown (OID 0). In all other cases, the input must
887 * match an existing pg_class entry.
893 Node *escontext = fcinfo->context;
897 /* Handle "-" or numeric OID */
901 /* Else it's a name, possibly schema-qualified */
903 /* The rest of this wouldn't work in bootstrap mode */
905 elog(
ERROR,
"regclass values must be OIDs in bootstrap mode");
908 * Normal case: parse the name into components and see if it matches any
909 * pg_class entries in the current search path.
915 /* We might not even have permissions on this relation; don't lock it. */
921 errmsg(
"relation \"%s\" does not exist",
928 * to_regclass - converts "classname" to class OID
930 * If the name is not found, we return NULL.
948 * regclassout - converts class OID to "class_name"
968 char *classname =
NameStr(classform->relname);
971 * In bootstrap mode, skip the fancy namespace stuff and just return
972 * the class name. (This path is only needed for debugging output
982 * Would this class be found by regclassin? If not, qualify it.
996 /* If OID doesn't match any pg_class entry, return it numerically */
1005 * regclassrecv - converts external binary format to regclass
1010 /* Exactly the same as oidrecv, so share code */
1015 * regclasssend - converts regclass to binary format
1020 /* Exactly the same as oidsend, so share code */
1026 * regcollationin - converts "collationname" to collation OID
1028 * We also accept a numeric OID, for symmetry with the output routine.
1030 * '-' signifies unknown (OID 0). In all other cases, the input must
1031 * match an existing pg_collation entry.
1037 Node *escontext = fcinfo->context;
1041 /* Handle "-" or numeric OID */
1045 /* Else it's a name, possibly schema-qualified */
1047 /* The rest of this wouldn't work in bootstrap mode */
1049 elog(
ERROR,
"regcollation values must be OIDs in bootstrap mode");
1052 * Normal case: parse the name into components and see if it matches any
1053 * pg_collation entries in the current search path.
1063 (
errcode(ERRCODE_UNDEFINED_OBJECT),
1064 errmsg(
"collation \"%s\" for encoding \"%s\" does not exist",
1071 * to_regcollation - converts "collationname" to collation OID
1073 * If the name is not found, we return NULL.
1084 (
Node *) &escontext,
1091 * regcollationout - converts collation OID to "collation_name"
1111 char *collationname =
NameStr(collationform->collname);
1114 * In bootstrap mode, skip the fancy namespace stuff and just return
1115 * the collation name. (This path is only needed for debugging output
1119 result =
pstrdup(collationname);
1125 * Would this collation be found by regcollationin? If not,
1140 /* If OID doesn't match any pg_collation entry, return it numerically */
1149 * regcollationrecv - converts external binary format to regcollation
1154 /* Exactly the same as oidrecv, so share code */
1159 * regcollationsend - converts regcollation to binary format
1164 /* Exactly the same as oidsend, so share code */
1170 * regtypein - converts "typename" to type OID
1172 * The type name can be specified using the full type syntax recognized by
1173 * the parser; for example, DOUBLE PRECISION and INTEGER[] will work and be
1174 * translated to the correct type names. (We ignore any typmod info
1175 * generated by the parser, however.)
1177 * We also accept a numeric OID, for symmetry with the output routine,
1178 * and for possible use in bootstrap mode.
1180 * '-' signifies unknown (OID 0). In all other cases, the input must
1181 * match an existing pg_type entry.
1187 Node *escontext = fcinfo->context;
1191 /* Handle "-" or numeric OID */
1195 /* Else it's a type name, possibly schema-qualified or decorated */
1197 /* The rest of this wouldn't work in bootstrap mode */
1199 elog(
ERROR,
"regtype values must be OIDs in bootstrap mode");
1202 * Normal case: invoke the full parser to deal with special cases such as
1203 * array syntax. We don't need to check for parseTypeString failure,
1204 * since we'll just return anyway.
1212 * to_regtype - converts "typename" to type OID
1214 * If the name is not found, we return NULL.
1225 (
Node *) &escontext,
1232 * to_regtypemod - converts "typename" to type modifier
1234 * If the name is not found, we return NULL.
1244 /* We rely on parseTypeString to parse the input. */
1252 * regtypeout - converts type OID to "typ_name"
1274 * In bootstrap mode, skip the fancy namespace stuff and just return
1275 * the type name. (This path is only needed for debugging output
1291 /* If OID doesn't match any pg_type entry, return it numerically */
1300 * regtyperecv - converts external binary format to regtype
1305 /* Exactly the same as oidrecv, so share code */
1310 * regtypesend - converts regtype to binary format
1315 /* Exactly the same as oidsend, so share code */
1321 * regconfigin - converts "tsconfigname" to tsconfig OID
1323 * We also accept a numeric OID, for symmetry with the output routine.
1325 * '-' signifies unknown (OID 0). In all other cases, the input must
1326 * match an existing pg_ts_config entry.
1332 Node *escontext = fcinfo->context;
1336 /* Handle "-" or numeric OID */
1340 /* The rest of this wouldn't work in bootstrap mode */
1342 elog(
ERROR,
"regconfig values must be OIDs in bootstrap mode");
1345 * Normal case: parse the name into components and see if it matches any
1346 * pg_ts_config entries in the current search path.
1356 (
errcode(ERRCODE_UNDEFINED_OBJECT),
1357 errmsg(
"text search configuration \"%s\" does not exist",
1364 * regconfigout - converts tsconfig OID to "tsconfigname"
1384 char *cfgname =
NameStr(cfgform->cfgname);
1388 * Would this config be found by regconfigin? If not, qualify it.
1401 /* If OID doesn't match any pg_ts_config row, return it numerically */
1410 * regconfigrecv - converts external binary format to regconfig
1415 /* Exactly the same as oidrecv, so share code */
1420 * regconfigsend - converts regconfig to binary format
1425 /* Exactly the same as oidsend, so share code */
1431 * regdictionaryin - converts "tsdictionaryname" to tsdictionary OID
1433 * We also accept a numeric OID, for symmetry with the output routine.
1435 * '-' signifies unknown (OID 0). In all other cases, the input must
1436 * match an existing pg_ts_dict entry.
1442 Node *escontext = fcinfo->context;
1446 /* Handle "-" or numeric OID */
1450 /* The rest of this wouldn't work in bootstrap mode */
1452 elog(
ERROR,
"regdictionary values must be OIDs in bootstrap mode");
1455 * Normal case: parse the name into components and see if it matches any
1456 * pg_ts_dict entries in the current search path.
1466 (
errcode(ERRCODE_UNDEFINED_OBJECT),
1467 errmsg(
"text search dictionary \"%s\" does not exist",
1474 * regdictionaryout - converts tsdictionary OID to "tsdictionaryname"
1494 char *dictname =
NameStr(dictform->dictname);
1498 * Would this dictionary be found by regdictionaryin? If not, qualify
1512 /* If OID doesn't match any pg_ts_dict row, return it numerically */
1521 * regdictionaryrecv - converts external binary format to regdictionary
1526 /* Exactly the same as oidrecv, so share code */
1531 * regdictionarysend - converts regdictionary to binary format
1536 /* Exactly the same as oidsend, so share code */
1541 * regrolein - converts "rolename" to role OID
1543 * We also accept a numeric OID, for symmetry with the output routine.
1545 * '-' signifies unknown (OID 0). In all other cases, the input must
1546 * match an existing pg_authid entry.
1552 Node *escontext = fcinfo->context;
1556 /* Handle "-" or numeric OID */
1560 /* The rest of this wouldn't work in bootstrap mode */
1562 elog(
ERROR,
"regrole values must be OIDs in bootstrap mode");
1564 /* Normal case: see if the name matches any pg_authid entry. */
1571 (
errcode(ERRCODE_INVALID_NAME),
1572 errmsg(
"invalid name syntax")));
1578 (
errcode(ERRCODE_UNDEFINED_OBJECT),
1579 errmsg(
"role \"%s\" does not exist",
1586 * to_regrole - converts "rolename" to role OID
1588 * If the name is not found, we return NULL.
1599 (
Node *) &escontext,
1606 * regroleout - converts role OID to "role_name"
1624 /* pstrdup is not really necessary, but it avoids a compiler warning */
1629 /* If OID doesn't match any role, return it numerically */
1638 * regrolerecv - converts external binary format to regrole
1643 /* Exactly the same as oidrecv, so share code */
1648 * regrolesend - converts regrole to binary format
1653 /* Exactly the same as oidsend, so share code */
1658 * regnamespacein - converts "nspname" to namespace OID
1660 * We also accept a numeric OID, for symmetry with the output routine.
1662 * '-' signifies unknown (OID 0). In all other cases, the input must
1663 * match an existing pg_namespace entry.
1669 Node *escontext = fcinfo->context;
1673 /* Handle "-" or numeric OID */
1677 /* The rest of this wouldn't work in bootstrap mode */
1679 elog(
ERROR,
"regnamespace values must be OIDs in bootstrap mode");
1681 /* Normal case: see if the name matches any pg_namespace entry. */
1688 (
errcode(ERRCODE_INVALID_NAME),
1689 errmsg(
"invalid name syntax")));
1695 (
errcode(ERRCODE_UNDEFINED_SCHEMA),
1696 errmsg(
"schema \"%s\" does not exist",
1703 * to_regnamespace - converts "nspname" to namespace OID
1705 * If the name is not found, we return NULL.
1716 (
Node *) &escontext,
1723 * regnamespaceout - converts namespace OID to "nsp_name"
1741 /* pstrdup is not really necessary, but it avoids a compiler warning */
1746 /* If OID doesn't match any namespace, return it numerically */
1755 * regnamespacerecv - converts external binary format to regnamespace
1760 /* Exactly the same as oidrecv, so share code */
1765 * regnamespacesend - converts regnamespace to binary format
1770 /* Exactly the same as oidsend, so share code */
1775 * regdatabasein - converts database name to database OID
1777 * We also accept a numeric OID, for symmetry with the output routine.
1779 * '-' signifies unknown (OID 0). In all other cases, the input must
1780 * match an existing pg_database entry.
1786 Node *escontext = fcinfo->context;
1790 /* Handle "-" or numeric OID */
1794 /* The rest of this wouldn't work in bootstrap mode */
1796 elog(
ERROR,
"regdatabase values must be OIDs in bootstrap mode");
1798 /* Normal case: see if the name matches any pg_database entry. */
1805 (
errcode(ERRCODE_INVALID_NAME),
1806 errmsg(
"invalid name syntax")));
1812 (
errcode(ERRCODE_UNDEFINED_OBJECT),
1813 errmsg(
"database \"%s\" does not exist",
1820 * to_regdatabase - converts database name to database OID
1822 * If the name is not found, we return NULL.
1833 (
Node *) &escontext,
1840 * regdatabaseout - converts database OID to database name
1858 /* pstrdup is not really necessary, but it avoids a compiler warning */
1863 /* If OID doesn't match any database, return it numerically */
1872 * regdatabaserecv - converts external binary format to regdatabase
1877 /* Exactly the same as oidrecv, so share code */
1882 * regdatabasesend - converts regdatabase to binary format
1887 /* Exactly the same as oidsend, so share code */
1892 * text_regclass: convert text to regclass
1894 * This could be replaced by CoerceViaIO, except that we need to treat
1895 * text-to-regclass as an implicit cast to support legacy forms of nextval()
1896 * and related functions.
1907 /* We might not even have permissions on this relation; don't lock it. */
1915 * Given a C string, parse it into a qualified-name list.
1917 * If escontext is an ErrorSaveContext node, invalid input will be
1918 * reported there instead of being thrown, and we return NIL.
1919 * (NIL is not possible as a success return, since empty-input is an error.)
1929 /* We need a modifiable copy of the input string. */
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);
1955/*****************************************************************************
1956 * SUPPORT ROUTINES *
1957 *****************************************************************************/
1960 * Given a C string, see if it is all-digits (and not empty).
1961 * If so, convert directly to OID and return true.
1962 * If it is not all-digits, return false.
1964 * If escontext is an ErrorSaveContext node, any error in oidin() will be
1965 * reported there instead of being thrown (but we still return true).
1970 if (
string[0] >=
'0' &&
string[0] <=
'9' &&
1971 strspn(
string,
"0123456789") == strlen(
string))
1975 /* We need not care here whether oidin() fails or not. */
1984 /* Prevent uninitialized-variable warnings from stupider compilers. */
1990 * As above, but also accept "-" as meaning 0 (InvalidOid).
1996 if (strcmp(
string,
"-") == 0)
2007 * Given a C string, parse it into a qualified function or operator name
2008 * followed by a parenthesized list of type names. Reduce the
2009 * type names to an array of OIDs (returned into *nargs and *argtypes;
2010 * the argtypes array should be of size FUNC_MAX_ARGS). The function or
2011 * operator name is returned to *names as a List of Strings.
2013 * If allowNone is true, accept "NONE" and return it as InvalidOid (this is
2014 * for unary operators).
2016 * Returns true on success, false on failure (the latter only possible
2017 * if escontext is an ErrorSaveContext node).
2021 int *nargs,
Oid *argtypes,
2034 /* We need a modifiable copy of the input string. */
2037 /* Scan to find the expected left paren; mustn't be quoted */
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")));
2051 /* Separate the name and parse it into a list */
2057 /* Check for the trailing right parenthesis and remove it */
2058 ptr2 = ptr + strlen(ptr);
2059 while (--ptr2 > ptr)
2066 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
2067 errmsg(
"expected a right parenthesis")));
2071 /* Separate the remaining string into comma-separated type names */
2077 /* allow leading whitespace */
2082 /* End of string. Okay unless we had a comma before. */
2085 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
2086 errmsg(
"expected a type name")));
2090 /* Find end of type name --- end of string or comma */
2091 /* ... but not a quoted or parenthesized comma */
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")));
2131 /* Lop off trailing whitespace */
2132 while (--ptr2 >=
typename)
2141 /* Special case for NONE */
2147 /* Use full parser to resolve the type name */
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)