@@ -230,7 +230,7 @@ static void AccessTempTableNamespace(bool force);
230230static void InitTempTableNamespace (void );
231231static void RemoveTempRelations (Oid tempNamespaceId );
232232static 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 );
234234static bool MatchNamedCall (HeapTuple proctup , int nargs , List * argnames ,
235235 bool include_out_arguments , int pronargs ,
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 */
47714785static void
4772- NamespaceCallback (Datum arg , int cacheid , uint32 hashvalue )
4786+ InvalidationCallback (Datum arg , int cacheid , uint32 hashvalue )
47734787{
47744788 /*
47754789 * Force search path to be recomputed on next use, also invalidating the
0 commit comments