diff --git a/doc/src/sgml/mvcc.sgml b/doc/src/sgml/mvcc.sgml index 24613e3c75..a93b31ae6d 100644 --- a/doc/src/sgml/mvcc.sgml +++ b/doc/src/sgml/mvcc.sgml @@ -971,6 +971,7 @@ ERROR: could not serialize access due to read/write dependencies among transact Acquired by CREATE COLLATION, + ALTER ROLE, CREATE TRIGGER, and many forms of ALTER TABLE (see ). diff --git a/src/backend/commands/user.c b/src/backend/commands/user.c index f2941352d7..d2e300d949 100644 --- a/src/backend/commands/user.c +++ b/src/backend/commands/user.c @@ -671,9 +671,11 @@ AlterRole(AlterRoleStmt *stmt) bypassrls = intVal(dbypassRLS->arg); /* - * Scan the pg_authid relation to be certain the user exists. + * Scan the pg_authid relation to be certain the user exists. Take + * ShareRowExclusiveLock to prevent other sessions to update this + * tuple in parallel with another ALTER ROLE command. */ - pg_authid_rel = heap_open(AuthIdRelationId, RowExclusiveLock); + pg_authid_rel = heap_open(AuthIdRelationId, ShareRowExclusiveLock); pg_authid_dsc = RelationGetDescr(pg_authid_rel); tuple = get_rolespec_tuple(stmt->role);