Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb3bd182

Browse files
committed
Fix missing invalidations for search_path cache.
Reported-by: Noah MischDiscussion:https://postgr.es/m/20240630223047.1f.nmisch@google.comBackpatch-through: 17
1 parente719248 commitb3bd182

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

‎src/backend/catalog/namespace.c

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ static void AccessTempTableNamespace(bool force);
230230
staticvoidInitTempTableNamespace(void);
231231
staticvoidRemoveTempRelations(OidtempNamespaceId);
232232
staticvoidRemoveTempRelationsCallback(intcode,Datumarg);
233-
staticvoidNamespaceCallback(Datumarg,intcacheid,uint32hashvalue);
233+
staticvoidInvalidationCallback(Datumarg,intcacheid,uint32hashvalue);
234234
staticboolMatchNamedCall(HeapTupleproctup,intnargs,List*argnames,
235235
boolinclude_out_arguments,intpronargs,
236236
int**argnumbers);
@@ -4749,27 +4749,41 @@ InitializeSearchPath(void)
47494749

47504750
/*
47514751
* In normal mode, arrange for a callback on any syscache invalidation
4752-
* of pg_namespace or pg_authid rows. (Changing a role name may affect
4753-
* the meaning of the special string $user.)
4752+
* that will affect the search_path cache.
47544753
*/
4754+
4755+
/* namespace name or ACLs may have changed */
47554756
CacheRegisterSyscacheCallback(NAMESPACEOID,
4756-
NamespaceCallback,
4757+
InvalidationCallback,
47574758
(Datum)0);
4759+
4760+
/* role name may affect the meaning of "$user" */
47584761
CacheRegisterSyscacheCallback(AUTHOID,
4759-
NamespaceCallback,
4762+
InvalidationCallback,
4763+
(Datum)0);
4764+
4765+
/* role membership may affect ACLs */
4766+
CacheRegisterSyscacheCallback(AUTHMEMROLEMEM,
4767+
InvalidationCallback,
47604768
(Datum)0);
4769+
4770+
/* database owner may affect ACLs */
4771+
CacheRegisterSyscacheCallback(DATABASEOID,
4772+
InvalidationCallback,
4773+
(Datum)0);
4774+
47614775
/* Force search path to be recomputed on next use */
47624776
baseSearchPathValid= false;
47634777
searchPathCacheValid= false;
47644778
}
47654779
}
47664780

47674781
/*
4768-
*NamespaceCallback
4782+
*InvalidationCallback
47694783
*Syscache inval callback function
47704784
*/
47714785
staticvoid
4772-
NamespaceCallback(Datumarg,intcacheid,uint32hashvalue)
4786+
InvalidationCallback(Datumarg,intcacheid,uint32hashvalue)
47734787
{
47744788
/*
47754789
* Force search path to be recomputed on next use, also invalidating the

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp