'Creating a role/user that only displays list of accessible tables
I'm trying to tighten up some roles/user privileges for my postgresql db. What I'm trying to achieve is a readonly user to ONLY be able to see the list of tables they have access to.
I've created a role:
CREATE ROLE readonly;
Granting readonly privileges to certain tables:
GRANT SELECT on TABLE table_1 to readonly;
GRANT SELECT on TABLE table_2 to readonly;
Created the user:
CREATE USER readonlyuser with password '<password>';
Assigned readonly role:
GRANT readonly on readonlyuser;
But still, when I run \d when I'm signed in as that user it still lists ALL tables (including tables that this user does not have access to)
And same goes for running \du, which lists ALL users and roles.
Is there anyway to only display the tables this user has access to and also not allowing to view the users/roles list?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
