summaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorJeff Davis2023-08-07 22:09:11 +0000
committerJeff Davis2023-08-07 22:09:11 +0000
commit43ba5105a8e0c28e893bd698f76211b5ea757145 (patch)
tree72fca69a06624077b16fb00236c618f199561235 /src/backend
parenta2cbee74b0e174da7bcb441c142022216b9b266f (diff)
Recalculate search_path after ALTER ROLE.
Renaming a role can affect the meaning of the special string $user, so must cause search_path to be recalculated. Discussion: https://postgr.es/m/186761d32c0255debbdf50b6310b581b9c973e6c.camel@j-davis.com Reviewed-by: Nathan Bossart, Michael Paquier Backpatch-through: 11
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/catalog/namespace.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/backend/catalog/namespace.c b/src/backend/catalog/namespace.c
index 1b948b6e6d6..ef25a519277 100644
--- a/src/backend/catalog/namespace.c
+++ b/src/backend/catalog/namespace.c
@@ -4284,11 +4284,15 @@ InitializeSearchPath(void)
{
/*
* In normal mode, arrange for a callback on any syscache invalidation
- * of pg_namespace rows.
+ * of pg_namespace or pg_authid rows. (Changing a role name may affect
+ * the meaning of the special string $user.)
*/
CacheRegisterSyscacheCallback(NAMESPACEOID,
NamespaceCallback,
(Datum) 0);
+ CacheRegisterSyscacheCallback(AUTHOID,
+ NamespaceCallback,
+ (Datum) 0);
/* Force search path to be recomputed on next use */
baseSearchPathValid = false;
}