Skip to content

sql: dropping multiple roles who have privileges should only show error for one role #52314

@RichardJCai

Description

@RichardJCai

When dropping multiple roles that have privileges, if there is a conflict ie a user has privileges on an object, PG only shows the error for the first conflict. Currently we show the errors for all the roles at once, this can be hard to process.

We should also combine the error messages for both having a privilege on an object and owning an object.

PG EXAMPLE

bench=# drop user hello1, hello2;
ERROR:  role "hello1" cannot be dropped because some objects depend on it
DETAIL:  owner of table t22
bench=# drop user hello2, hello1;
ERROR:  role "hello2" cannot be dropped because some objects depend on it
DETAIL:  privileges for table t3
owner of database d2
owner of table t23

Metadata

Metadata

Assignees

Labels

A-error-handlingError messages, error propagations/annotationsC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions