raphael
raphael

Reputation: 2823

Is there a way to grant SELECT on a table but prevent users creating VIEWs from it?

I have a table that gets regularly and automatically dropped and recreated. I would like users to be able to select from it but not be able to create VIEWs that would prevent this automatic dropping from happening, is there a way to do so? We're stuck on PostgreSQL 9.6, if that's relevant.

Upvotes: 0

Views: 108

Answers (1)

David Valladares L.
David Valladares L.

Reputation: 138

For what I know and the documentation for Postgress 9.6 SELECT privilege allow to select from tables and objects you have granted access to, but that doesn't include the creation of VIEWS. To create views you need the CREATE privilege, so my suggestion is that you revoke the CREATE privilege to the users and grant the SELECT one

Upvotes: 1

Related Questions