Improve wording for privilege description on certain failure messages; the

original misleadingly suggests that only access is meant, causing confusion.
Per recent trouble report by Robert McGehee on pgsql-admin.
This commit is contained in:
Alvaro Herrera 2010-08-26 19:49:08 +00:00
parent 3a1b51de19
commit 7788b76acd
3 changed files with 10 additions and 10 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/catalog/pg_shdepend.c,v 1.44 2010/07/28 05:22:24 sriggs Exp $
* $PostgreSQL: pgsql/src/backend/catalog/pg_shdepend.c,v 1.45 2010/08/26 19:49:08 alvherre Exp $
*
*-------------------------------------------------------------------------
*/
@ -1067,7 +1067,7 @@ storeObjectDescription(StringInfo descs, objectType type,
if (deptype == SHARED_DEPENDENCY_OWNER)
appendStringInfo(descs, _("owner of %s"), objdesc);
else if (deptype == SHARED_DEPENDENCY_ACL)
appendStringInfo(descs, _("access to %s"), objdesc);
appendStringInfo(descs, _("privileges for %s"), objdesc);
else
elog(ERROR, "unrecognized dependency type: %d",
(int) deptype);

View File

@ -13,10 +13,10 @@ GRANT ALL ON TABLE deptest TO regression_user, regression_user2;
-- can't drop neither because they have privileges somewhere
DROP USER regression_user;
ERROR: role "regression_user" cannot be dropped because some objects depend on it
DETAIL: access to table deptest
DETAIL: privileges for table deptest
DROP GROUP regression_group;
ERROR: role "regression_group" cannot be dropped because some objects depend on it
DETAIL: access to table deptest
DETAIL: privileges for table deptest
-- if we revoke the privileges we can drop the group
REVOKE SELECT ON deptest FROM GROUP regression_group;
DROP GROUP regression_group;
@ -24,7 +24,7 @@ DROP GROUP regression_group;
REVOKE SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES ON deptest FROM regression_user;
DROP USER regression_user;
ERROR: role "regression_user" cannot be dropped because some objects depend on it
DETAIL: access to table deptest
DETAIL: privileges for table deptest
-- now we are OK to drop him
REVOKE TRIGGER ON deptest FROM regression_user;
DROP USER regression_user;
@ -110,7 +110,7 @@ REASSIGN OWNED BY regression_user1 TO regression_user2;
-- doesn't work: grant still exists
DROP USER regression_user1;
ERROR: role "regression_user1" cannot be dropped because some objects depend on it
DETAIL: access to table deptest1
DETAIL: privileges for table deptest1
DROP OWNED BY regression_user1;
DROP USER regression_user1;
\set VERBOSITY terse

View File

@ -412,7 +412,7 @@ RESET ROLE;
DROP ROLE regress_test_indirect; -- ERROR
ERROR: role "regress_test_indirect" cannot be dropped because some objects depend on it
DETAIL: owner of server s1
access to foreign-data wrapper foo
privileges for foreign-data wrapper foo
\des+
List of foreign servers
Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | Options
@ -941,8 +941,8 @@ RESET ROLE;
-- Cleanup
DROP ROLE regress_test_role; -- ERROR
ERROR: role "regress_test_role" cannot be dropped because some objects depend on it
DETAIL: access to server s4
access to foreign-data wrapper foo
DETAIL: privileges for server s4
privileges for foreign-data wrapper foo
owner of user mapping for regress_test_role
owner of user mapping for regress_test_role
owner of server s5
@ -968,7 +968,7 @@ DROP ROLE regress_test_indirect;
DROP ROLE regress_test_role;
DROP ROLE unprivileged_role; -- ERROR
ERROR: role "unprivileged_role" cannot be dropped because some objects depend on it
DETAIL: access to foreign-data wrapper postgresql
DETAIL: privileges for foreign-data wrapper postgresql
REVOKE ALL ON FOREIGN DATA WRAPPER postgresql FROM unprivileged_role;
DROP ROLE unprivileged_role;
DROP ROLE regress_test_role2;