Reputation: 73
How can I revoke access to a database for a user?
I tried REVOKE ALL PRIVILEGES ON DATABASE dev FROM public_readonly; and still I can connect.
Looks like by default all users can connect to all databases.
Note that this is a Redshift question so solution with pgpass changes will obviously not relevant.
Upvotes: 3
Views: 530
Reputation: 8647
You are probably talking about a superuser account:
The masteruser, which is the user you created when you launched the cluster, is a superuser.
And
A database superuser bypasses all permission checks. Be very careful when using a superuser role. We recommend that you do most of your work as a role that is not a superuser. Superusers retain all privileges regardless of GRANT and REVOKE commands.
That is probably the reason why you can still connect.
To create less powerful users use normal CREATE USER statement, then all permissions should work as expected.
Upvotes: 1