235 bool include_out_arguments,
int pronargs,
276 return a.roleid ==
b.roleid &&
277 strcmp(
a.searchPath,
b.searchPath) == 0;
280#define SH_PREFIX nsphash
281#define SH_ELEMENT_TYPE SearchPathCacheEntry
282#define SH_KEY_TYPE SearchPathCacheKey
284#define SH_HASH_KEY(tb, key) spcachekey_hash(key)
285#define SH_EQUAL(tb, a, b) spcachekey_equal(a, b)
286#define SH_SCOPE static inline
297#define SPCACHE_RESET_THRESHOLD 256
326 "search_path processing cache",
461 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
462 errmsg(
"cross-database references are not implemented: \"%s.%s.%s\"",
518 (
errcode(ERRCODE_INVALID_TABLE_DEFINITION),
519 errmsg(
"temporary tables cannot specify a schema name")));
553 callback(relation, relId, oldRelId, callback_arg);
576 if (relId == oldRelId)
599 (
errcode(ERRCODE_LOCK_NOT_AVAILABLE),
600 errmsg(
"could not obtain lock on relation \"%s.%s\"",
604 (
errcode(ERRCODE_LOCK_NOT_AVAILABLE),
605 errmsg(
"could not obtain lock on relation \"%s\"",
633 errmsg(
"relation \"%s.%s\" does not exist",
638 errmsg(
"relation \"%s\" does not exist",
665 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
666 errmsg(
"cross-database references are not implemented: \"%s.%s.%s\"",
674 if (strcmp(newRelation->
schemaname,
"pg_temp") == 0)
703 (
errcode(ERRCODE_UNDEFINED_SCHEMA),
704 errmsg(
"no schema has been selected to create in")));
741 Oid *existing_relation_id)
757 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
758 errmsg(
"cross-database references are not implemented: \"%s.%s.%s\"",
778 if (existing_relation_id != NULL)
800 if (relid == oldrelid &&
nspid == oldnspid)
803 if (
nspid != oldnspid)
812 if (
nspid != oldnspid)
821 if (relid != oldrelid)
836 if (existing_relation_id != NULL)
837 *existing_relation_id = relid;
850 case RELPERSISTENCE_TEMP:
855 (
errcode(ERRCODE_INVALID_TABLE_DEFINITION),
856 errmsg(
"cannot create relations in temporary schemas of other sessions")));
859 (
errcode(ERRCODE_INVALID_TABLE_DEFINITION),
860 errmsg(
"cannot create temporary relation in non-temporary schema")));
863 case RELPERSISTENCE_PERMANENT:
868 (
errcode(ERRCODE_INVALID_TABLE_DEFINITION),
869 errmsg(
"cannot create relations in temporary schemas of other sessions")));
874 (
errcode(ERRCODE_INVALID_TABLE_DEFINITION),
875 errmsg(
"only temporary relations may be created in temporary schemas")));
935 if (is_missing != NULL)
940 elog(
ERROR,
"cache lookup failed for relation %u", relid);
951 relnamespace = relform->relnamespace;
952 if (relnamespace != PG_CATALOG_NAMESPACE &&
970 if (namespaceId == relnamespace)
1062 if (is_missing != NULL)
1067 elog(
ERROR,
"cache lookup failed for type %u", typid);
1078 typnamespace = typform->typnamespace;
1079 if (typnamespace != PG_CATALOG_NAMESPACE &&
1097 if (namespaceId == typnamespace)
1193 bool expand_variadic,
bool expand_defaults,
1194 bool include_out_arguments,
bool missing_ok)
1197 bool any_special =
false;
1205 Assert(nargs >= 0 || !(expand_variadic | expand_defaults));
1231 Oid *proargtypes = procform->proargtypes.values;
1233 int effective_nargs;
1238 int *argnumbers = NULL;
1244 if (procform->pronamespace != namespaceId)
1257 if (procform->pronamespace ==
lfirst_oid(nsp) &&
1272 if (include_out_arguments)
1274 Datum proallargtypes;
1278 Anum_pg_proc_proallargtypes,
1289 elog(
ERROR,
"proallargtypes is not a 1-D Oid array or it contains nulls");
1295 if (argnames !=
NIL)
1304 if (
OidIsValid(procform->provariadic) && expand_variadic)
1314 if (
pronargs > nargs && expand_defaults)
1317 if (nargs + procform->pronargdefaults <
pronargs)
1319 use_defaults =
true;
1322 use_defaults =
false;
1325 if (
pronargs != nargs && !use_defaults)
1346 if (
pronargs <= nargs && expand_variadic)
1348 va_elem_type = procform->provariadic;
1350 any_special |= variadic;
1361 if (
pronargs > nargs && expand_defaults)
1364 if (nargs + procform->pronargdefaults <
pronargs)
1366 use_defaults =
true;
1370 use_defaults =
false;
1373 if (nargs >= 0 &&
pronargs != nargs && !variadic && !use_defaults)
1386 effective_nargs *
sizeof(
Oid));
1388 newResult->
oid = procform->oid;
1390 newResult->
nargs = effective_nargs;
1396 newResult->
args[
j] = proargtypes[argnumbers[
j]];
1407 for (
int j =
pronargs - 1;
j < effective_nargs;
j++)
1408 newResult->
args[
j] = va_elem_type;
1422 if (resultList != NULL &&
1438 if (catlist->
ordered && !any_special)
1441 if (effective_nargs == resultList->
nargs &&
1442 memcmp(newResult->
args,
1444 effective_nargs *
sizeof(
Oid)) == 0)
1445 prevResult = resultList;
1451 int cmp_nargs = newResult->
nargs - newResult->
ndargs;
1453 for (prevResult = resultList;
1455 prevResult = prevResult->
next)
1457 if (cmp_nargs == prevResult->
nargs - prevResult->
ndargs &&
1458 memcmp(newResult->
args,
1460 cmp_nargs *
sizeof(
Oid)) == 0)
1476 if (pathpos != prevResult->
pathpos)
1481 preference = pathpos - prevResult->
pathpos;
1483 else if (variadic && prevResult->
nvargs == 0)
1493 else if (!variadic && prevResult->
nvargs > 0)
1517 else if (preference < 0)
1520 if (prevResult == resultList)
1521 resultList = prevResult->
next;
1526 for (prevPrevResult = resultList;
1528 prevPrevResult = prevPrevResult->
next)
1530 if (prevResult == prevPrevResult->
next)
1532 prevPrevResult->
next = prevResult->
next;
1554 newResult->
next = resultList;
1555 resultList = newResult;
1586 bool include_out_arguments,
int pronargs,
1613 &p_argtypes, &p_argnames, &p_argmodes);
1614 Assert(p_argnames != NULL);
1620 memset(arggiven,
false,
pronargs *
sizeof(
bool));
1623 for (ap = 0; ap < numposargs; ap++)
1625 (*argnumbers)[ap] = ap;
1626 arggiven[ap] =
true;
1630 foreach(lc, argnames)
1632 char *argname = (
char *)
lfirst(lc);
1638 for (
i = 0;
i < pronallargs;
i++)
1641 if (!include_out_arguments &&
1647 if (p_argnames[
i] && strcmp(p_argnames[
i], argname) == 0)
1652 arggiven[pp] =
true;
1653 (*argnumbers)[ap] = pp;
1671 int first_arg_with_default =
pronargs - procform->pronargdefaults;
1673 for (pp = numposargs; pp <
pronargs; pp++)
1678 if (pp < first_arg_with_default)
1680 (*argnumbers)[ap++] = pp;
1718 if (is_missing != NULL)
1723 elog(
ERROR,
"cache lookup failed for function %u", funcid);
1734 pronamespace = procform->pronamespace;
1735 if (pronamespace != PG_CATALOG_NAMESPACE &&
1747 int nargs = procform->pronargs;
1753 nargs,
NIL,
false,
false,
false,
false);
1755 for (; clist; clist = clist->
next)
1757 if (memcmp(clist->
args, procform->proargtypes.values,
1758 nargs *
sizeof(
Oid)) == 0)
1761 visible = (clist->
oid == funcid);
1813 Oid result = operclass->oid;
1856 if (operform->oprnamespace == namespaceId)
1858 Oid result = operform->oid;
1891 char *resultSpace = NULL;
1906 if (missing_schema_ok && !
OidIsValid(namespaceId))
1928#define SPACE_PER_OP MAXALIGN(offsetof(struct _FuncCandidateList, args) + \
1942 if (oprkind && operform->oprkind != oprkind)
1948 if (operform->oprnamespace != namespaceId)
1962 if (operform->oprnamespace ==
lfirst_oid(nsp) &&
1987 if (operform->oprleft == resultList->
args[0] &&
1988 operform->oprright == resultList->
args[1])
1989 prevResult = resultList;
1995 for (prevResult = resultList;
1997 prevResult = prevResult->
next)
1999 if (operform->oprleft == prevResult->
args[0] &&
2000 operform->oprright == prevResult->
args[1])
2008 if (pathpos > prevResult->
pathpos)
2011 prevResult->
pathpos = pathpos;
2012 prevResult->
oid = operform->oid;
2025 newResult->
oid = operform->oid;
2027 newResult->
nargs = 2;
2031 newResult->
args[0] = operform->oprleft;
2032 newResult->
args[1] = operform->oprright;
2033 newResult->
next = resultList;
2034 resultList = newResult;
2071 if (is_missing != NULL)
2087 oprnamespace = oprform->oprnamespace;
2088 if (oprnamespace != PG_CATALOG_NAMESPACE &&
2099 char *oprname =
NameStr(oprform->oprname);
2102 oprform->oprleft, oprform->oprright)
2176 if (is_missing != NULL)
2181 elog(
ERROR,
"cache lookup failed for opclass %u", opcid);
2192 opcnamespace = opcform->opcnamespace;
2193 if (opcnamespace != PG_CATALOG_NAMESPACE &&
2204 char *opcname =
NameStr(opcform->opcname);
2278 if (is_missing != NULL)
2283 elog(
ERROR,
"cache lookup failed for opfamily %u", opfid);
2294 opfnamespace = opfform->opfnamespace;
2295 if (opfnamespace != PG_CATALOG_NAMESPACE &&
2306 char *opfname =
NameStr(opfform->opfname);
2349 if (collform->collprovider == COLLPROVIDER_ICU)
2429 if (is_missing != NULL)
2445 collnamespace = collform->collnamespace;
2446 if (collnamespace != PG_CATALOG_NAMESPACE &&
2458 char *collname =
NameStr(collform->collname);
2531 if (is_missing != NULL)
2536 elog(
ERROR,
"cache lookup failed for conversion %u", conid);
2547 connamespace = conform->connamespace;
2548 if (connamespace != PG_CATALOG_NAMESPACE &&
2559 char *conname =
NameStr(conform->conname);
2593 stats_oid =
GetSysCacheOid2(STATEXTNAMENSP, Anum_pg_statistic_ext_oid,
2608 stats_oid =
GetSysCacheOid2(STATEXTNAMENSP, Anum_pg_statistic_ext_oid,
2618 (
errcode(ERRCODE_UNDEFINED_OBJECT),
2619 errmsg(
"statistics object \"%s\" does not exist",
2654 if (is_missing != NULL)
2659 elog(
ERROR,
"cache lookup failed for statistics object %u", stxid);
2670 stxnamespace = stxform->stxnamespace;
2671 if (stxnamespace != PG_CATALOG_NAMESPACE &&
2681 char *stxname =
NameStr(stxform->stxname);
2689 if (namespaceId == stxnamespace)
2760 (
errcode(ERRCODE_UNDEFINED_OBJECT),
2761 errmsg(
"text search parser \"%s\" does not exist",
2796 if (is_missing != NULL)
2801 elog(
ERROR,
"cache lookup failed for text search parser %u", prsId);
2812 namespace = form->prsnamespace;
2813 if (
namespace != PG_CATALOG_NAMESPACE &&
2834 if (namespaceId ==
namespace)
2905 (
errcode(ERRCODE_UNDEFINED_OBJECT),
2906 errmsg(
"text search dictionary \"%s\" does not exist",
2941 if (is_missing != NULL)
2946 elog(
ERROR,
"cache lookup failed for text search dictionary %u",
2958 namespace = form->dictnamespace;
2959 if (
namespace != PG_CATALOG_NAMESPACE &&
2980 if (namespaceId ==
namespace)
3010 char *template_name;
3051 (
errcode(ERRCODE_UNDEFINED_OBJECT),
3052 errmsg(
"text search template \"%s\" does not exist",
3087 if (is_missing != NULL)
3092 elog(
ERROR,
"cache lookup failed for text search template %u", tmplId);
3103 namespace = form->tmplnamespace;
3104 if (
namespace != PG_CATALOG_NAMESPACE &&
3125 if (namespaceId ==
namespace)
3196 (
errcode(ERRCODE_UNDEFINED_OBJECT),
3197 errmsg(
"text search configuration \"%s\" does not exist",
3232 if (is_missing != NULL)
3237 elog(
ERROR,
"cache lookup failed for text search configuration %u",
3249 namespace = form->cfgnamespace;
3250 if (
namespace != PG_CATALOG_NAMESPACE &&
3271 if (namespaceId ==
namespace)
3306 char *schemaname = NULL;
3307 char *objname = NULL;
3328 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
3329 errmsg(
"cross-database references are not implemented: %s",
3334 (
errcode(ERRCODE_SYNTAX_ERROR),
3335 errmsg(
"improper qualified name (too many dotted names): %s",
3340 *nspname_p = schemaname;
3341 *objname_p = objname;
3358 if (strcmp(nspname,
"pg_temp") == 0)
3391 if (strcmp(nspname,
"pg_temp") == 0)
3434 if (strcmp(nspname,
"pg_temp") == 0)
3464 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
3465 errmsg(
"cannot move objects into or out of temporary schemas")));
3468 if (nspOid == PG_TOAST_NAMESPACE || oldNspOid == PG_TOAST_NAMESPACE)
3470 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
3471 errmsg(
"cannot move objects into or out of TOAST schema")));
3498 if (strcmp(schemaname,
"pg_temp") == 0)
3521 (
errcode(ERRCODE_UNDEFINED_SCHEMA),
3522 errmsg(
"no schema has been selected to create in")));
3543 (
errcode(ERRCODE_UNDEFINED_SCHEMA),
3544 errmsg(
"schema \"%s\" does not exist", nspname)));
3574 (
errcode(ERRCODE_SYNTAX_ERROR),
3575 errmsg(
"improper relation name (too many dotted names): %s",
3613 elog(
ERROR,
"unexpected node type in name list: %d",
3696 result = (strncmp(nspname,
"pg_temp_", 8) == 0) ||
3697 (strncmp(nspname,
"pg_toast_temp_", 14) == 0);
3775 if (strncmp(nspname,
"pg_temp_", 8) == 0)
3776 result = atoi(nspname + 8);
3777 else if (strncmp(nspname,
"pg_toast_temp_", 14) == 0)
3778 result = atoi(nspname + 14);
3936 if (lc &&
lfirst_oid(lc) == PG_CATALOG_NAMESPACE)
3974 char *collation_name;
4015 (
errcode(ERRCODE_UNDEFINED_OBJECT),
4016 errmsg(
"collation \"%s\" for encoding \"%s\" does not exist",
4028 char *conversion_name;
4070 (
errcode(ERRCODE_UNDEFINED_OBJECT),
4071 errmsg(
"conversion \"%s\" does not exist",
4116 rawname =
pstrdup(searchPath);
4133 *temp_missing =
false;
4134 foreach(l, namelist)
4136 char *curname = (
char *)
lfirst(l);
4139 if (strcmp(curname,
"$user") == 0)
4158 else if (strcmp(curname,
"pg_temp") == 0)
4167 *temp_missing =
true;
4203 foreach(lc, oidlist)
4219 if (finalPath ==
NIL)
4230 finalPath =
lcons_oid(PG_CATALOG_NAMESPACE, finalPath);
4315 pathChanged =
false;
4411 (
errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
4412 errmsg(
"permission denied to create temporary tables in database \"%s\"",
4427 (
errcode(ERRCODE_READ_ONLY_SQL_TRANSACTION),
4428 errmsg(
"cannot create temporary tables during recovery")));
4433 (
errcode(ERRCODE_READ_ONLY_SQL_TRANSACTION),
4434 errmsg(
"cannot create temporary tables during a parallel operation")));
4468 snprintf(namespaceName,
sizeof(namespaceName),
"pg_toast_temp_%d",
4609 object.
classId = NamespaceRelationId;
4610 object.objectId = tempNamespaceId;
4611 object.objectSubId = 0;
4660 const char *searchPath = *
newval;
4690 rawname =
pstrdup(searchPath);
4839 if (!includeImplicit)
4873 if (count < sarray_len)
4874 sarray[count] = namespaceId;
4898 bool is_missing =
false;
4912 bool is_missing =
false;
4926 bool is_missing =
false;
4940 bool is_missing =
false;
4954 bool is_missing =
false;
4968 bool is_missing =
false;
4982 bool is_missing =
false;
4996 bool is_missing =
false;
5010 bool is_missing =
false;
5024 bool is_missing =
false;
5038 bool is_missing =
false;
5052 bool is_missing =
false;
5066 bool is_missing =
false;
void aclcheck_error(AclResult aclerr, ObjectType objtype, const char *objectname)
AclResult object_aclcheck(Oid classid, Oid objectid, Oid roleid, AclMode mode)
bool object_ownercheck(Oid classid, Oid objectid, Oid roleid)
#define DatumGetArrayTypeP(X)
#define InvalidSubTransactionId
#define Assert(condition)
#define OidIsValid(objectId)
char * get_database_name(Oid dbid)
void performDeletion(const ObjectAddress *object, DropBehavior behavior, int flags)
#define PERFORM_DELETION_SKIP_EXTENSIONS
#define PERFORM_DELETION_QUIETLY
#define PERFORM_DELETION_SKIP_ORIGINAL
#define PERFORM_DELETION_INTERNAL
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
bool is_encoding_supported_by_icu(int encoding)
bool equal(const void *a, const void *b)
#define PG_RETURN_BOOL(x)
int get_func_arg_info(HeapTuple procTup, Oid **p_argtypes, char ***p_argnames, char **p_argmodes)
#define GUC_check_errdetail
static size_t fasthash_accum_cstring(fasthash_state *hs, const char *str)
static uint32 fasthash_final32(fasthash_state *hs, uint64 tweak)
static void fasthash_combine(fasthash_state *hs)
static void fasthash_init(fasthash_state *hs, uint64 seed)
#define HeapTupleIsValid(tuple)
#define IsParallelWorker()
void AcceptInvalidationMessages(void)
void CacheRegisterSyscacheCallback(int cacheid, SyscacheCallbackFunction func, Datum arg)
void before_shmem_exit(pg_on_exit_callback function, Datum arg)
List * lcons_oid(Oid datum, List *list)
List * list_delete_first(List *list)
List * list_copy(const List *oldlist)
List * lappend_oid(List *list, Oid datum)
void list_free(List *list)
bool list_member_oid(const List *list, Oid datum)
bool ConditionalLockRelationOid(Oid relid, LOCKMODE lockmode)
void UnlockRelationOid(Oid relid, LOCKMODE lockmode)
void LockDatabaseObject(Oid classid, Oid objid, uint16 objsubid, LOCKMODE lockmode)
void LockRelationOid(Oid relid, LOCKMODE lockmode)
void UnlockDatabaseObject(Oid classid, Oid objid, uint16 objsubid, LOCKMODE lockmode)
char get_rel_relkind(Oid relid)
char * get_namespace_name(Oid nspid)
Oid get_relname_relid(const char *relname, Oid relnamespace)
RangeVar * makeRangeVar(char *schemaname, char *relname, int location)
int GetDatabaseEncoding(void)
const char * GetDatabaseEncodingName(void)
char * MemoryContextStrdup(MemoryContext context, const char *string)
void MemoryContextReset(MemoryContext context)
char * pstrdup(const char *in)
void pfree(void *pointer)
void * palloc0(Size size)
MemoryContext TopMemoryContext
#define AllocSetContextCreate
#define ALLOCSET_DEFAULT_SIZES
#define IsBootstrapProcessingMode()
static const SearchPathCacheEntry * cachedNamespacePath(const char *searchPath, Oid roleid)
Oid RangeVarGetAndCheckCreationNamespace(RangeVar *relation, LOCKMODE lockmode, Oid *existing_relation_id)
Oid OpclassnameGetOpcid(Oid amid, const char *opcname)
static bool CollationIsVisibleExt(Oid collid, bool *is_missing)
bool isTempOrTempToastNamespace(Oid namespaceId)
void ResetTempTableNamespace(void)
static bool baseTempCreationPending
Oid FindDefaultConversionProc(int32 for_encoding, int32 to_encoding)
Oid OpernameGetOprid(List *names, Oid oprleft, Oid oprright)
char * NameListToString(const List *names)
Oid LookupExplicitNamespace(const char *nspname, bool missing_ok)
static SearchPathCacheEntry * spcache_lookup(const char *searchPath, Oid roleid)
Datum pg_is_other_temp_schema(PG_FUNCTION_ARGS)
bool TSTemplateIsVisible(Oid tmplId)
Oid QualifiedNameGetCreationNamespace(const List *names, char **objname_p)
bool OpfamilyIsVisible(Oid opfid)
bool CollationIsVisible(Oid collid)
static Oid baseCreationNamespace
bool TypeIsVisible(Oid typid)
bool isOtherTempNamespace(Oid namespaceId)
static MemoryContext SearchPathCacheContext
static bool searchPathCacheValid
static Oid lookup_collation(const char *collname, Oid collnamespace, int32 encoding)
Oid CollationGetCollid(const char *collname)
void assign_search_path(const char *newval, void *extra)
static Oid activeCreationNamespace
bool isTempNamespace(Oid namespaceId)
bool isAnyTempNamespace(Oid namespaceId)
Datum pg_operator_is_visible(PG_FUNCTION_ARGS)
static List * activeSearchPath
bool ConversionIsVisible(Oid conid)
static bool baseSearchPathValid
static SubTransactionId myTempNamespaceSubID
Oid get_statistics_object_oid(List *names, bool missing_ok)
Oid LookupCreationNamespace(const char *nspname)
void RangeVarAdjustRelationPersistence(RangeVar *newRelation, Oid nspid)
static Oid myTempToastNamespace
Datum pg_collation_is_visible(PG_FUNCTION_ARGS)
Oid get_collation_oid(List *collname, bool missing_ok)
void DeconstructQualifiedName(const List *names, char **nspname_p, char **objname_p)
Datum pg_function_is_visible(PG_FUNCTION_ARGS)
Datum pg_type_is_visible(PG_FUNCTION_ARGS)
static bool OpclassIsVisibleExt(Oid opcid, bool *is_missing)
static bool RelationIsVisibleExt(Oid relid, bool *is_missing)
List * fetch_search_path(bool includeImplicit)
static bool FunctionIsVisibleExt(Oid funcid, bool *is_missing)
FuncCandidateList FuncnameGetCandidates(List *names, int nargs, List *argnames, bool expand_variadic, bool expand_defaults, bool include_out_arguments, bool missing_ok)
Datum pg_opclass_is_visible(PG_FUNCTION_ARGS)
Oid get_namespace_oid(const char *nspname, bool missing_ok)
static SearchPathCacheEntry * spcache_insert(const char *searchPath, Oid roleid)
SearchPathMatcher * GetSearchPathMatcher(MemoryContext context)
Oid TypenameGetTypidExtended(const char *typname, bool temp_ok)
static bool TSDictionaryIsVisibleExt(Oid dictId, bool *is_missing)
char * NameListToQuotedString(const List *names)
Oid RangeVarGetCreationNamespace(const RangeVar *newRelation)
bool RelationIsVisible(Oid relid)
static List * preprocessNamespacePath(const char *searchPath, Oid roleid, bool *temp_missing)
Datum pg_ts_config_is_visible(PG_FUNCTION_ARGS)
static void spcache_init(void)
Datum pg_opfamily_is_visible(PG_FUNCTION_ARGS)
bool OpclassIsVisible(Oid opcid)
Oid ConversionGetConid(const char *conname)
void AtEOSubXact_Namespace(bool isCommit, SubTransactionId mySubid, SubTransactionId parentSubid)
static List * finalNamespacePath(List *oidlist, Oid *firstNS)
TempNamespaceStatus checkTempNamespaceStatus(Oid namespaceId)
Datum pg_conversion_is_visible(PG_FUNCTION_ARGS)
void CheckSetNamespace(Oid oldNspOid, Oid nspOid)
static SearchPathCacheEntry * LastSearchPathCacheEntry
void GetTempNamespaceState(Oid *tempNamespaceId, Oid *tempToastNamespaceId)
void InitializeSearchPath(void)
static bool TSParserIsVisibleExt(Oid prsId, bool *is_missing)
static bool StatisticsObjIsVisibleExt(Oid stxid, bool *is_missing)
bool OperatorIsVisible(Oid oprid)
static bool TSTemplateIsVisibleExt(Oid tmplId, bool *is_missing)
char * namespace_search_path
bool TSParserIsVisible(Oid prsId)
static void RemoveTempRelations(Oid tempNamespaceId)
static void recomputeNamespacePath(void)
static Oid myTempNamespace
#define SPCACHE_RESET_THRESHOLD
bool SearchPathMatchesCurrentEnvironment(SearchPathMatcher *path)
Datum pg_statistics_obj_is_visible(PG_FUNCTION_ARGS)
static nsphash_hash * SearchPathCache
static bool MatchNamedCall(HeapTuple proctup, int nargs, List *argnames, bool include_out_arguments, int pronargs, int **argnumbers)
static bool ConversionIsVisibleExt(Oid conid, bool *is_missing)
static bool activeTempCreationPending
Oid get_conversion_oid(List *conname, bool missing_ok)
static void InitTempTableNamespace(void)
bool FunctionIsVisible(Oid funcid)
Oid get_ts_dict_oid(List *names, bool missing_ok)
static bool OperatorIsVisibleExt(Oid oprid, bool *is_missing)
Oid get_ts_parser_oid(List *names, bool missing_ok)
Datum pg_ts_template_is_visible(PG_FUNCTION_ARGS)
static bool TSConfigIsVisibleExt(Oid cfgid, bool *is_missing)
static bool TypeIsVisibleExt(Oid typid, bool *is_missing)
SearchPathMatcher * CopySearchPathMatcher(SearchPathMatcher *path)
static void AccessTempTableNamespace(bool force)
void SetTempNamespaceState(Oid tempNamespaceId, Oid tempToastNamespaceId)
static void InvalidationCallback(Datum arg, int cacheid, uint32 hashvalue)
Oid GetTempToastNamespace(void)
static bool OpfamilyIsVisibleExt(Oid opfid, bool *is_missing)
Oid OpfamilynameGetOpfid(Oid amid, const char *opfname)
RangeVar * makeRangeVarFromNameList(const List *names)
void AtEOXact_Namespace(bool isCommit, bool parallel)
Oid get_ts_config_oid(List *names, bool missing_ok)
static bool spcachekey_equal(SearchPathCacheKey a, SearchPathCacheKey b)
FuncCandidateList OpernameGetCandidates(List *names, char oprkind, bool missing_schema_ok)
bool check_search_path(char **newval, void **extra, GucSource source)
Oid LookupNamespaceNoError(const char *nspname)
struct SearchPathCacheKey SearchPathCacheKey
ProcNumber GetTempNamespaceProcNumber(Oid namespaceId)
static void RemoveTempRelationsCallback(int code, Datum arg)
Oid TypenameGetTypid(const char *typname)
int fetch_search_path_array(Oid *sarray, int sarray_len)
Oid RangeVarGetRelidExtended(const RangeVar *relation, LOCKMODE lockmode, uint32 flags, RangeVarGetRelidCallback callback, void *callback_arg)
struct SearchPathCacheEntry SearchPathCacheEntry
static uint32 spcachekey_hash(SearchPathCacheKey key)
static uint64 activePathGeneration
bool TSConfigIsVisible(Oid cfgid)
bool StatisticsObjIsVisible(Oid stxid)
Datum pg_ts_dict_is_visible(PG_FUNCTION_ARGS)
Oid RelnameGetRelid(const char *relname)
static List * baseSearchPath
Datum pg_my_temp_schema(PG_FUNCTION_ARGS)
Datum pg_ts_parser_is_visible(PG_FUNCTION_ARGS)
bool TSDictionaryIsVisible(Oid dictId)
Datum pg_table_is_visible(PG_FUNCTION_ARGS)
bool isTempToastNamespace(Oid namespaceId)
Oid get_ts_template_oid(List *names, bool missing_ok)
void(* RangeVarGetRelidCallback)(const RangeVar *relation, Oid relId, Oid oldRelId, void *callback_arg)
@ TEMP_NAMESPACE_NOT_TEMP
struct _FuncCandidateList * FuncCandidateList
#define IsA(nodeptr, _type_)
object_access_hook_type object_access_hook
#define InvokeNamespaceSearchHook(objectId, ereport_on_violation)
ObjectType get_relkind_objtype(char relkind)
FormData_pg_authid * Form_pg_authid
FormData_pg_class * Form_pg_class
FormData_pg_collation * Form_pg_collation
Oid FindDefaultConversion(Oid name_space, int32 for_encoding, int32 to_encoding)
FormData_pg_conversion * Form_pg_conversion
static int list_length(const List *l)
#define list_make1_oid(x1)
static ListCell * list_head(const List *l)
static ListCell * lnext(const List *l, const ListCell *c)
Oid NamespaceCreate(const char *nspName, Oid ownerId, bool isTemp)
FormData_pg_opclass * Form_pg_opclass
FormData_pg_operator * Form_pg_operator
FormData_pg_opfamily * Form_pg_opfamily
FormData_pg_proc * Form_pg_proc
static rewind_source * source
FormData_pg_statistic_ext * Form_pg_statistic_ext
FormData_pg_ts_config * Form_pg_ts_config
FormData_pg_ts_dict * Form_pg_ts_dict
FormData_pg_ts_parser * Form_pg_ts_parser
FormData_pg_ts_template * Form_pg_ts_template
FormData_pg_type * Form_pg_type
#define ERRCODE_UNDEFINED_TABLE
static Datum PointerGetDatum(const void *X)
static Datum ObjectIdGetDatum(Oid X)
static Datum CStringGetDatum(const char *X)
static Datum Int32GetDatum(int32 X)
PGPROC * ProcNumberGetProc(ProcNumber procNumber)
#define INVALID_PROC_NUMBER
MemoryContextSwitchTo(old_ctx)
const char * quote_identifier(const char *ident)
uint64 SharedInvalidMessageCounter
Snapshot GetTransactionSnapshot(void)
void PushActiveSnapshot(Snapshot snapshot)
void PopActiveSnapshot(void)
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]
CatCTup * members[FLEXIBLE_ARRAY_MEMBER]
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
HeapTuple SearchSysCache3(int cacheId, Datum key1, Datum key2, Datum key3)
Datum SysCacheGetAttr(int cacheId, HeapTuple tup, AttrNumber attributeNumber, bool *isNull)
HeapTuple SearchSysCache4(int cacheId, Datum key1, Datum key2, Datum key3, Datum key4)
#define SearchSysCacheList3(cacheId, key1, key2, key3)
#define ReleaseSysCacheList(x)
#define SearchSysCacheExists2(cacheId, key1, key2)
#define SearchSysCacheList1(cacheId, key1)
#define GetSysCacheOid3(cacheId, oidcol, key1, key2, key3)
#define GetSysCacheOid1(cacheId, oidcol, key1)
#define GetSysCacheOid2(cacheId, oidcol, key1, key2)
static void callback(struct sockaddr *addr, struct sockaddr *mask, void *unused)
String * makeString(char *str)
bool SplitIdentifierString(char *rawstring, char separator, List **namelist)
SubTransactionId GetCurrentSubTransactionId(void)
void CommandCounterIncrement(void)
void StartTransactionCommand(void)
void CommitTransactionCommand(void)
void AbortOutOfAnyTransaction(void)
#define XACT_FLAGS_ACCESSEDTEMPNAMESPACE
bool RecoveryInProgress(void)