Re: PG V9.6 / REVOKE SELECT columns ON TABLE T1 FROM John
Vik Fearing <[email protected]> Fri, 19 Oct 2018 21:45:53 +0200
| Newsgroups | gmane.comp.db.postgresql.french |
|---|---|
| Organization | 2ndQuadrant France |
| Message-ID | <[email protected]> |
On 19/10/2018 18:20, DECHERF Étienne wrote: > Hello, > > I 've created a PostgreSQL user "John" with REVOKE SELECT columns from him. > but "REVOKE SELECT (ipp , nom_nais , nom , prenom) ON TABLE table1 FROM > "John";" command doesn't work in my script above : La *seule* action de REVOKE est d'annuler un GRANT. Si tu n'as pas fait de GRANT sur la colonne, un REVOKE ne fera rien. Comme le GRANT est sur la table entière, il faut d'abord l'enlever et ensuite faire des GRANTs sur toutes les colonnes souhaitées. C'est écrit dans la doc aussi: "A user may perform SELECT, INSERT, etc. on a column if they hold that privilege for either the specific column or its whole table. Granting the privilege at the table level and then revoking it for one column will not do what one might wish: the table-level grant is unaffected by a column-level operation." https://www.postgresql.org/docs/current/static/sql-grant.html#SQL-GRANT-NOTES -- Vik Fearing +33 6 46 75 15 36 http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support