Reputation: 1932
I've created a user in redshift for a database, then I granted few SELECT permissions in a schema. Now I need to delete but I can't because the system insists that even after revoking all permissions the user can't be dropped because it has still access to some object.
When I create the user:
CREATE USER etlglue WITH
PASSWORD '******';
grant select on all tables in schema tbl to etlglue;
Now when I try to drop:
REVOKE ALL PRIVILEGES ON SCHEMA tbl FROM etlglue;
REVOKE ALL PRIVILEGES ON SCHEMA public FROM etlglue;
REVOKE ALL PRIVILEGES ON DATABASE db FROM etlglue;
DROP USER etlglue;
I have tried to apply even a CASCADE in the REVOKE command but neither, I went to the documentation here. But the output:
Upvotes: 3
Views: 8235
Reputation: 37
Use the following script from aws-labs to find out what objects are owned by the user that you are trying to drop.
After that edit/drop object and proceed.
Upvotes: 1
Reputation: 416
Revoking privileges off schema does not automatically revoke the privileges granted on tables in that schema. Try executing
REVOKE ALL PRIVILEGES ON ALL TABLES IN SCHEMA tbl FROM etlglue.
along with your other REVOKE statements.
Upvotes: 2