Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in BI by (17.6k points)

I am currently working within Postgres, and am in the process of creating some users. Whilst creating these users and testing them I've noticed that they're able to view more Schemas than they have access to. In addition to this, they can view restricted Schemas tables, views, and functions. This isn't ideal.

When creating users and their permissions are there a way to have a user set up in such a way that they're only able to view certain Schemas and not all Schemas at large within our database?

I should also mention that these users would be viewing our Postgres database utilizing either PgAdmin or Tableau.

1 Answer

0 votes
by (47.2k points)

  • Yes. Use the command GRANT USAGE ON [schemaname] TO [username] or REVOKE USAGE ON [schemaname] FROM [username] to control access to the Schema itself.

  • You might need to do REVOKE USAGE ON [schemaname] FROM public to remove the default access permissions as well.

  • I suggest reviewing https://www.postgresql.org/docs/current/static/sql-grant.html for the full set of GRANT commands available as you may need to grant/revoke read/write access on some tables as well.

Related questions

0 votes
2 answers
0 votes
1 answer
asked Dec 16, 2020 in SQL by Appu (6.1k points)
0 votes
1 answer
0 votes
2 answers
asked Oct 16, 2020 in BI by Sudhir_1997 (55.6k points)

1.2k questions

2.7k answers

501 comments

693 users

Browse Categories

...