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
446 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
447 errmsg(
"cross-database references are not implemented: \"%s.%s.%s\"",
503 (
errcode(ERRCODE_INVALID_TABLE_DEFINITION),
504 errmsg(
"temporary tables cannot specify a schema name")));
538 callback(relation, relId, oldRelId, callback_arg);
561 if (relId == oldRelId)
584 (
errcode(ERRCODE_LOCK_NOT_AVAILABLE),
585 errmsg(
"could not obtain lock on relation \"%s.%s\"",
589 (
errcode(ERRCODE_LOCK_NOT_AVAILABLE),
590 errmsg(
"could not obtain lock on relation \"%s\"",
618 errmsg(
"relation \"%s.%s\" does not exist",
623 errmsg(
"relation \"%s\" does not exist",
650 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
651 errmsg(
"cross-database references are not implemented: \"%s.%s.%s\"",
659 if (strcmp(newRelation->
schemaname,
"pg_temp") == 0)
688 (
errcode(ERRCODE_UNDEFINED_SCHEMA),
689 errmsg(
"no schema has been selected to create in")));
726 Oid *existing_relation_id)
742 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
743 errmsg(
"cross-database references are not implemented: \"%s.%s.%s\"",
763 if (existing_relation_id != NULL)
785 if (relid == oldrelid &&
nspid == oldnspid)
788 if (
nspid != oldnspid)
797 if (
nspid != oldnspid)
806 if (relid != oldrelid)
821 if (existing_relation_id != NULL)
822 *existing_relation_id = relid;
835 case RELPERSISTENCE_TEMP:
840 (
errcode(ERRCODE_INVALID_TABLE_DEFINITION),
841 errmsg(
"cannot create relations in temporary schemas of other sessions")));
844 (
errcode(ERRCODE_INVALID_TABLE_DEFINITION),
845 errmsg(
"cannot create temporary relation in non-temporary schema")));
848 case RELPERSISTENCE_PERMANENT:
853 (
errcode(ERRCODE_INVALID_TABLE_DEFINITION),
854 errmsg(
"cannot create relations in temporary schemas of other sessions")));
859 (
errcode(ERRCODE_INVALID_TABLE_DEFINITION),
860 errmsg(
"only temporary relations may be created in temporary schemas")));
920 if (is_missing != NULL)
925 elog(
ERROR,
"cache lookup failed for relation %u", relid);
936 relnamespace = relform->relnamespace;
937 if (relnamespace != PG_CATALOG_NAMESPACE &&
955 if (namespaceId == relnamespace)
1047 if (is_missing != NULL)
1052 elog(
ERROR,
"cache lookup failed for type %u", typid);
1063 typnamespace = typform->typnamespace;
1064 if (typnamespace != PG_CATALOG_NAMESPACE &&
1082 if (namespaceId == typnamespace)
1178 bool expand_variadic,
bool expand_defaults,
1179 bool include_out_arguments,
bool missing_ok)
1182 bool any_special =
false;
1190 Assert(nargs >= 0 || !(expand_variadic | expand_defaults));
1216 Oid *proargtypes = procform->proargtypes.values;
1218 int effective_nargs;
1223 int *argnumbers = NULL;
1229 if (procform->pronamespace != namespaceId)
1242 if (procform->pronamespace ==
lfirst_oid(nsp) &&
1257 if (include_out_arguments)
1259 Datum proallargtypes;
1263 Anum_pg_proc_proallargtypes,
1274 elog(
ERROR,
"proallargtypes is not a 1-D Oid array or it contains nulls");
1280 if (argnames !=
NIL)
1289 if (
OidIsValid(procform->provariadic) && expand_variadic)
1299 if (
pronargs > nargs && expand_defaults)
1302 if (nargs + procform->pronargdefaults <
pronargs)
1304 use_defaults =
true;
1307 use_defaults =
false;
1310 if (
pronargs != nargs && !use_defaults)
1331 if (
pronargs <= nargs && expand_variadic)
1333 va_elem_type = procform->provariadic;
1335 any_special |= variadic;
1346 if (
pronargs > nargs && expand_defaults)
1349 if (nargs + procform->pronargdefaults <
pronargs)
1351 use_defaults =
true;
1355 use_defaults =
false;
1358 if (nargs >= 0 &&
pronargs != nargs && !variadic && !use_defaults)
1371 effective_nargs *
sizeof(
Oid));
1373 newResult->
oid = procform->oid;
1375 newResult->
nargs = effective_nargs;
1381 newResult->
args[
j] = proargtypes[argnumbers[
j]];
1392 for (
int j =
pronargs - 1;
j < effective_nargs;
j++)
1393 newResult->
args[
j] = va_elem_type;
1407 if (resultList != NULL &&
1423 if (catlist->
ordered && !any_special)
1426 if (effective_nargs == resultList->
nargs &&
1427 memcmp(newResult->
args,
1429 effective_nargs *
sizeof(
Oid)) == 0)
1430 prevResult = resultList;
1436 int cmp_nargs = newResult->
nargs - newResult->
ndargs;
1438 for (prevResult = resultList;
1440 prevResult = prevResult->
next)
1442 if (cmp_nargs == prevResult->
nargs - prevResult->
ndargs &&
1443 memcmp(newResult->
args,
1445 cmp_nargs *
sizeof(
Oid)) == 0)
1461 if (pathpos != prevResult->
pathpos)
1466 preference = pathpos - prevResult->
pathpos;
1468 else if (variadic && prevResult->
nvargs == 0)
1478 else if (!variadic && prevResult->
nvargs > 0)
1502 else if (preference < 0)
1505 if (prevResult == resultList)
1506 resultList = prevResult->
next;
1511 for (prevPrevResult = resultList;
1513 prevPrevResult = prevPrevResult->
next)
1515 if (prevResult == prevPrevResult->
next)
1517 prevPrevResult->
next = prevResult->
next;
1539 newResult->
next = resultList;
1540 resultList = newResult;
1571 bool include_out_arguments,
int pronargs,
1598 &p_argtypes, &p_argnames, &p_argmodes);
1599 Assert(p_argnames != NULL);
1605 memset(arggiven,
false,
pronargs *
sizeof(
bool));
1608 for (ap = 0; ap < numposargs; ap++)
1610 (*argnumbers)[ap] = ap;
1611 arggiven[ap] =
true;
1615 foreach(lc, argnames)
1617 char *argname = (
char *)
lfirst(lc);
1623 for (
i = 0;
i < pronallargs;
i++)
1626 if (!include_out_arguments &&
1632 if (p_argnames[
i] && strcmp(p_argnames[
i], argname) == 0)
1637 arggiven[pp] =
true;
1638 (*argnumbers)[ap] = pp;
1656 int first_arg_with_default =
pronargs - procform->pronargdefaults;
1658 for (pp = numposargs; pp <
pronargs; pp++)
1663 if (pp < first_arg_with_default)
1665 (*argnumbers)[ap++] = pp;
1703 if (is_missing != NULL)
1708 elog(
ERROR,
"cache lookup failed for function %u", funcid);
1719 pronamespace = procform->pronamespace;
1720 if (pronamespace != PG_CATALOG_NAMESPACE &&
1732 int nargs = procform->pronargs;
1738 nargs,
NIL,
false,
false,
false,
false);
1740 for (; clist; clist = clist->
next)
1742 if (memcmp(clist->
args, procform->proargtypes.values,
1743 nargs *
sizeof(
Oid)) == 0)
1746 visible = (clist->
oid == funcid);
1798 Oid result = operclass->oid;
1841 if (operform->oprnamespace == namespaceId)
1843 Oid result = operform->oid;
1876 char *resultSpace = NULL;
1891 if (missing_schema_ok && !
OidIsValid(namespaceId))
1913 #define SPACE_PER_OP MAXALIGN(offsetof(struct _FuncCandidateList, args) + \
1927 if (oprkind && operform->oprkind != oprkind)
1933 if (operform->oprnamespace != namespaceId)
1947 if (operform->oprnamespace ==
lfirst_oid(nsp) &&
1972 if (operform->oprleft == resultList->
args[0] &&
1973 operform->oprright == resultList->
args[1])
1974 prevResult = resultList;
1980 for (prevResult = resultList;
1982 prevResult = prevResult->
next)
1984 if (operform->oprleft == prevResult->
args[0] &&
1985 operform->oprright == prevResult->
args[1])
1993 if (pathpos > prevResult->
pathpos)
1996 prevResult->
pathpos = pathpos;
1997 prevResult->
oid = operform->oid;
2010 newResult->
oid = operform->oid;
2012 newResult->
nargs = 2;
2016 newResult->
args[0] = operform->oprleft;
2017 newResult->
args[1] = operform->oprright;
2018 newResult->
next = resultList;
2019 resultList = newResult;
2056 if (is_missing != NULL)
2072 oprnamespace = oprform->oprnamespace;
2073 if (oprnamespace != PG_CATALOG_NAMESPACE &&
2084 char *oprname =
NameStr(oprform->oprname);
2087 oprform->oprleft, oprform->oprright)
2161 if (is_missing != NULL)
2166 elog(
ERROR,
"cache lookup failed for opclass %u", opcid);
2177 opcnamespace = opcform->opcnamespace;
2178 if (opcnamespace != PG_CATALOG_NAMESPACE &&
2189 char *opcname =
NameStr(opcform->opcname);
2263 if (is_missing != NULL)
2268 elog(
ERROR,
"cache lookup failed for opfamily %u", opfid);
2279 opfnamespace = opfform->opfnamespace;
2280 if (opfnamespace != PG_CATALOG_NAMESPACE &&
2291 char *opfname =
NameStr(opfform->opfname);
2334 if (collform->collprovider == COLLPROVIDER_ICU)
2414 if (is_missing != NULL)
2430 collnamespace = collform->collnamespace;
2431 if (collnamespace != PG_CATALOG_NAMESPACE &&
2443 char *collname =
NameStr(collform->collname);
2516 if (is_missing != NULL)
2521 elog(
ERROR,
"cache lookup failed for conversion %u", conid);
2532 connamespace = conform->connamespace;
2533 if (connamespace != PG_CATALOG_NAMESPACE &&
2544 char *conname =
NameStr(conform->conname);
2578 stats_oid =
GetSysCacheOid2(STATEXTNAMENSP, Anum_pg_statistic_ext_oid,
2593 stats_oid =
GetSysCacheOid2(STATEXTNAMENSP, Anum_pg_statistic_ext_oid,
2603 (
errcode(ERRCODE_UNDEFINED_OBJECT),
2604 errmsg(
"statistics object \"%s\" does not exist",
2639 if (is_missing != NULL)
2644 elog(
ERROR,
"cache lookup failed for statistics object %u", stxid);
2655 stxnamespace = stxform->stxnamespace;
2656 if (stxnamespace != PG_CATALOG_NAMESPACE &&
2666 char *stxname =
NameStr(stxform->stxname);
2674 if (namespaceId == stxnamespace)
2745 (
errcode(ERRCODE_UNDEFINED_OBJECT),
2746 errmsg(
"text search parser \"%s\" does not exist",
2781 if (is_missing != NULL)
2786 elog(
ERROR,
"cache lookup failed for text search parser %u", prsId);
2797 namespace = form->prsnamespace;
2798 if (
namespace != PG_CATALOG_NAMESPACE &&
2819 if (namespaceId ==
namespace)
2890 (
errcode(ERRCODE_UNDEFINED_OBJECT),
2891 errmsg(
"text search dictionary \"%s\" does not exist",
2926 if (is_missing != NULL)
2931 elog(
ERROR,
"cache lookup failed for text search dictionary %u",
2943 namespace = form->dictnamespace;
2944 if (
namespace != PG_CATALOG_NAMESPACE &&
2965 if (namespaceId ==
namespace)
2995 char *template_name;
3036 (
errcode(ERRCODE_UNDEFINED_OBJECT),
3037 errmsg(
"text search template \"%s\" does not exist",
3072 if (is_missing != NULL)
3077 elog(
ERROR,
"cache lookup failed for text search template %u", tmplId);
3088 namespace = form->tmplnamespace;
3089 if (
namespace != PG_CATALOG_NAMESPACE &&
3110 if (namespaceId ==
namespace)
3181 (
errcode(ERRCODE_UNDEFINED_OBJECT),
3182 errmsg(
"text search configuration \"%s\" does not exist",
3217 if (is_missing != NULL)
3222 elog(
ERROR,
"cache lookup failed for text search configuration %u",
3234 namespace = form->cfgnamespace;
3235 if (
namespace != PG_CATALOG_NAMESPACE &&
3256 if (namespaceId ==
namespace)
3291 char *schemaname = NULL;
3292 char *objname = NULL;
3313 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
3314 errmsg(
"cross-database references are not implemented: %s",
3319 (
errcode(ERRCODE_SYNTAX_ERROR),
3320 errmsg(
"improper qualified name (too many dotted names): %s",
3325 *nspname_p = schemaname;
3326 *objname_p = objname;
3343 if (strcmp(nspname,
"pg_temp") == 0)
3376 if (strcmp(nspname,
"pg_temp") == 0)
3419 if (strcmp(nspname,
"pg_temp") == 0)
3449 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
3450 errmsg(
"cannot move objects into or out of temporary schemas")));
3453 if (nspOid == PG_TOAST_NAMESPACE || oldNspOid == PG_TOAST_NAMESPACE)
3455 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
3456 errmsg(
"cannot move objects into or out of TOAST schema")));
3483 if (strcmp(schemaname,
"pg_temp") == 0)
3506 (
errcode(ERRCODE_UNDEFINED_SCHEMA),
3507 errmsg(
"no schema has been selected to create in")));
3528 (
errcode(ERRCODE_UNDEFINED_SCHEMA),
3529 errmsg(
"schema \"%s\" does not exist", nspname)));
3559 (
errcode(ERRCODE_SYNTAX_ERROR),
3560 errmsg(
"improper relation name (too many dotted names): %s",
3598 elog(
ERROR,
"unexpected node type in name list: %d",
3681 result = (strncmp(nspname,
"pg_temp_", 8) == 0) ||
3682 (strncmp(nspname,
"pg_toast_temp_", 14) == 0);
3760 if (strncmp(nspname,
"pg_temp_", 8) == 0)
3761 result = atoi(nspname + 8);
3762 else if (strncmp(nspname,
"pg_toast_temp_", 14) == 0)
3763 result = atoi(nspname + 14);
3921 if (lc &&
lfirst_oid(lc) == PG_CATALOG_NAMESPACE)
3959 char *collation_name;
4000 (
errcode(ERRCODE_UNDEFINED_OBJECT),
4001 errmsg(
"collation \"%s\" for encoding \"%s\" does not exist",
4013 char *conversion_name;
4055 (
errcode(ERRCODE_UNDEFINED_OBJECT),
4056 errmsg(
"conversion \"%s\" does not exist",
4101 rawname =
pstrdup(searchPath);
4118 *temp_missing =
false;
4119 foreach(l, namelist)
4121 char *curname = (
char *)
lfirst(l);
4124 if (strcmp(curname,
"$user") == 0)
4143 else if (strcmp(curname,
"pg_temp") == 0)
4152 *temp_missing =
true;
4188 foreach(lc, oidlist)
4204 if (finalPath ==
NIL)
4215 finalPath =
lcons_oid(PG_CATALOG_NAMESPACE, finalPath);
4300 pathChanged =
false;
4396 (
errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
4397 errmsg(
"permission denied to create temporary tables in database \"%s\"",
4412 (
errcode(ERRCODE_READ_ONLY_SQL_TRANSACTION),
4413 errmsg(
"cannot create temporary tables during recovery")));
4418 (
errcode(ERRCODE_READ_ONLY_SQL_TRANSACTION),
4419 errmsg(
"cannot create temporary tables during a parallel operation")));
4453 snprintf(namespaceName,
sizeof(namespaceName),
"pg_toast_temp_%d",
4594 object.
classId = NamespaceRelationId;
4595 object.objectId = tempNamespaceId;
4596 object.objectSubId = 0;
4645 const char *searchPath = *
newval;
4675 rawname =
pstrdup(searchPath);
4747 "search_path processing cache",
4829 if (!includeImplicit)
4863 if (count < sarray_len)
4864 sarray[count] = namespaceId;
4888 bool is_missing =
false;
4902 bool is_missing =
false;
4916 bool is_missing =
false;
4930 bool is_missing =
false;
4944 bool is_missing =
false;
4958 bool is_missing =
false;
4972 bool is_missing =
false;
4986 bool is_missing =
false;
5000 bool is_missing =
false;
5014 bool is_missing =
false;
5028 bool is_missing =
false;
5042 bool is_missing =
false;
5056 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 * lappend_oid(List *list, Oid datum)
List * list_copy(const List *oldlist)
List * list_delete_first(List *list)
void list_free(List *list)
bool list_member_oid(const List *list, Oid datum)
List * lcons_oid(Oid datum, List *list)
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_namespace_name(Oid nspid)
char get_rel_relkind(Oid relid)
Oid get_relname_relid(const char *relname, Oid relnamespace)
RangeVar * makeRangeVar(char *schemaname, char *relname, int location)
int GetDatabaseEncoding(void)
const char * GetDatabaseEncodingName(void)
void MemoryContextReset(MemoryContext context)
char * pstrdup(const char *in)
void pfree(void *pointer)
MemoryContext TopMemoryContext
void * palloc0(Size size)
char * MemoryContextStrdup(MemoryContext context, const char *string)
#define AllocSetContextCreate
#define ALLOCSET_DEFAULT_SIZES
#define IsBootstrapProcessingMode()
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)
Oid LookupExplicitNamespace(const char *nspname, bool missing_ok)
char * NameListToQuotedString(const List *names)
Datum pg_is_other_temp_schema(PG_FUNCTION_ARGS)
bool TSTemplateIsVisible(Oid tmplId)
Oid QualifiedNameGetCreationNamespace(const List *names, char **objname_p)
static List * finalNamespacePath(List *oidlist, Oid *firstNS)
bool OpfamilyIsVisible(Oid opfid)
static const SearchPathCacheEntry * cachedNamespacePath(const char *searchPath, Oid roleid)
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)
List * fetch_search_path(bool includeImplicit)
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)
static SearchPathCacheEntry * spcache_lookup(const char *searchPath, Oid roleid)
Datum pg_type_is_visible(PG_FUNCTION_ARGS)
static bool OpclassIsVisibleExt(Oid opcid, bool *is_missing)
static bool RelationIsVisibleExt(Oid relid, bool *is_missing)
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)
Oid TypenameGetTypidExtended(const char *typname, bool temp_ok)
static bool TSDictionaryIsVisibleExt(Oid dictId, bool *is_missing)
Oid RangeVarGetCreationNamespace(const RangeVar *newRelation)
bool RelationIsVisible(Oid relid)
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)
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)
RangeVar * makeRangeVarFromNameList(const List *names)
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)
SearchPathMatcher * CopySearchPathMatcher(SearchPathMatcher *path)
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 SearchPathCacheEntry * spcache_insert(const char *searchPath, Oid roleid)
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)
char * NameListToString(const List *names)
static bool TSConfigIsVisibleExt(Oid cfgid, bool *is_missing)
static bool TypeIsVisibleExt(Oid typid, bool *is_missing)
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)
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)
SearchPathMatcher * GetSearchPathMatcher(MemoryContext context)
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)
static List * preprocessNamespacePath(const char *searchPath, Oid roleid, bool *temp_missing)
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)