@@ -230,7 +230,7 @@ static void AccessTempTableNamespace(bool force);
230
230
static void InitTempTableNamespace (void );
231
231
static void RemoveTempRelations (Oid tempNamespaceId );
232
232
static void RemoveTempRelationsCallback (int code , Datum arg );
233
- static void NamespaceCallback (Datum arg , int cacheid , uint32 hashvalue );
233
+ static void InvalidationCallback (Datum arg , int cacheid , uint32 hashvalue );
234
234
static bool MatchNamedCall (HeapTuple proctup , int nargs , List * argnames ,
235
235
bool include_out_arguments , int pronargs ,
236
236
int * * argnumbers );
@@ -4749,27 +4749,41 @@ InitializeSearchPath(void)
4749
4749
4750
4750
/*
4751
4751
* 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.
4754
4753
*/
4754
+
4755
+ /* namespace name or ACLs may have changed */
4755
4756
CacheRegisterSyscacheCallback (NAMESPACEOID ,
4756
- NamespaceCallback ,
4757
+ InvalidationCallback ,
4757
4758
(Datum ) 0 );
4759
+
4760
+ /* role name may affect the meaning of "$user" */
4758
4761
CacheRegisterSyscacheCallback (AUTHOID ,
4759
- NamespaceCallback ,
4762
+ InvalidationCallback ,
4763
+ (Datum ) 0 );
4764
+
4765
+ /* role membership may affect ACLs */
4766
+ CacheRegisterSyscacheCallback (AUTHMEMROLEMEM ,
4767
+ InvalidationCallback ,
4760
4768
(Datum ) 0 );
4769
+
4770
+ /* database owner may affect ACLs */
4771
+ CacheRegisterSyscacheCallback (DATABASEOID ,
4772
+ InvalidationCallback ,
4773
+ (Datum ) 0 );
4774
+
4761
4775
/* Force search path to be recomputed on next use */
4762
4776
baseSearchPathValid = false;
4763
4777
searchPathCacheValid = false;
4764
4778
}
4765
4779
}
4766
4780
4767
4781
/*
4768
- * NamespaceCallback
4782
+ * InvalidationCallback
4769
4783
* Syscache inval callback function
4770
4784
*/
4771
4785
static void
4772
- NamespaceCallback (Datum arg , int cacheid , uint32 hashvalue )
4786
+ InvalidationCallback (Datum arg , int cacheid , uint32 hashvalue )
4773
4787
{
4774
4788
/*
4775
4789
* Force search path to be recomputed on next use, also invalidating the
0 commit comments