pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix an ALTER GROUP ... DROP USER error message.
3+ messages / 1 participants
[nested] [flat]

* pgsql: Fix an ALTER GROUP ... DROP USER error message.
@ 2025-01-09 23:13  Nathan Bossart <nathan@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Nathan Bossart @ 2025-01-09 23:13 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix an ALTER GROUP ... DROP USER error message.

This error message stated the privileges required to add a member
to a group even if the user was trying to drop a member:

        postgres=> alter group a drop user b;
        ERROR:  permission denied to alter role
        DETAIL:  Only roles with the ADMIN option on role "a" may add members.

Since the required privileges for both operations are the same, we
can fix this by modifying the message to mention both adding and
dropping members:

        postgres=> alter group a drop user b;
        ERROR:  permission denied to alter role
        DETAIL:  Only roles with the ADMIN option on role "a" may add or drop members.

Author: ChangAo Chen
Reviewed-by: Tom Lane
Discussion: https://postgr.es/m/tencent_FAA0D00E3514AAF0BBB6322542A6094FEF05%40qq.com
Backpatch-through: 16

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/39e3bcae44868734504c3decbb6708c36a5a84b2

Modified Files
--------------
src/backend/commands/user.c              | 4 ++--
src/test/regress/expected/privileges.out | 7 +++++++
src/test/regress/sql/privileges.sql      | 3 +++
3 files changed, 12 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Fix an ALTER GROUP ... DROP USER error message.
@ 2025-01-09 23:13  Nathan Bossart <nathan@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Nathan Bossart @ 2025-01-09 23:13 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix an ALTER GROUP ... DROP USER error message.

This error message stated the privileges required to add a member
to a group even if the user was trying to drop a member:

        postgres=> alter group a drop user b;
        ERROR:  permission denied to alter role
        DETAIL:  Only roles with the ADMIN option on role "a" may add members.

Since the required privileges for both operations are the same, we
can fix this by modifying the message to mention both adding and
dropping members:

        postgres=> alter group a drop user b;
        ERROR:  permission denied to alter role
        DETAIL:  Only roles with the ADMIN option on role "a" may add or drop members.

Author: ChangAo Chen
Reviewed-by: Tom Lane
Discussion: https://postgr.es/m/tencent_FAA0D00E3514AAF0BBB6322542A6094FEF05%40qq.com
Backpatch-through: 16

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/c559f61b547188f20ff9c54231f54cd9ef99b867

Modified Files
--------------
src/backend/commands/user.c              | 4 ++--
src/test/regress/expected/privileges.out | 7 +++++++
src/test/regress/sql/privileges.sql      | 3 +++
3 files changed, 12 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Fix an ALTER GROUP ... DROP USER error message.
@ 2025-01-09 23:13  Nathan Bossart <nathan@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Nathan Bossart @ 2025-01-09 23:13 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix an ALTER GROUP ... DROP USER error message.

This error message stated the privileges required to add a member
to a group even if the user was trying to drop a member:

        postgres=> alter group a drop user b;
        ERROR:  permission denied to alter role
        DETAIL:  Only roles with the ADMIN option on role "a" may add members.

Since the required privileges for both operations are the same, we
can fix this by modifying the message to mention both adding and
dropping members:

        postgres=> alter group a drop user b;
        ERROR:  permission denied to alter role
        DETAIL:  Only roles with the ADMIN option on role "a" may add or drop members.

Author: ChangAo Chen
Reviewed-by: Tom Lane
Discussion: https://postgr.es/m/tencent_FAA0D00E3514AAF0BBB6322542A6094FEF05%40qq.com
Backpatch-through: 16

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0b5927dfac26a620b0bed53d8955e68a134db452

Modified Files
--------------
src/backend/commands/user.c              | 4 ++--
src/test/regress/expected/privileges.out | 7 +++++++
src/test/regress/sql/privileges.sql      | 3 +++
3 files changed, 12 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2025-01-09 23:13 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-01-09 23:13 pgsql: Fix an ALTER GROUP ... DROP USER error message. Nathan Bossart <nathan@postgresql.org>
2025-01-09 23:13 pgsql: Fix an ALTER GROUP ... DROP USER error message. Nathan Bossart <nathan@postgresql.org>
2025-01-09 23:13 pgsql: Fix an ALTER GROUP ... DROP USER error message. Nathan Bossart <nathan@postgresql.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox