From: | Anthony Nowocien <anowocien(at)gmail(dot)com> |
---|---|
To: | etienne(dot)decherf-ext(at)aphp(dot)fr |
Cc: | pgsql-fr-generale(at)lists(dot)postgresql(dot)org |
Subject: | Re: PG V9.6 / REVOKE SELECT columns ON TABLE T1 FROM John |
Date: | 2018-10-19 17:27:48 |
Message-ID: | CAH5RRoPSAo-z1fmPpU6Ls8V-jwj=uQ+ebjV5jBrREd5Fa0dL=w@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-fr-generale |
Hi,
you could have a look at this answer:
https://stackoverflow.com/questions/48317818/revoke-particular-columns-in-postgresql.
That is, first revoking SELECT privileges on the TABLE, and then GRANTING
the columns you want.
Anthony
PS: French can also be used on this French mailing list :)
On Fri, Oct 19, 2018 at 6:20 PM DECHERF Étienne <etienne(dot)decherf-ext(at)aphp(dot)fr>
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 :
>
> Here is how I created the user "John":
>
> CREATE ROLE "john";
> REVOKE ALL PRIVILEGES ON DATABASE pgdb FROM "john";
> ALTER ROLE "john" WITH LOGIN;
> ALTER ROLE "john" WITH PASSWORD 'password' VALID UNTIL '2018-12-31';
> GRANT CONNECT ON DATABASE dbpg TO "john";
> GRANT USAGE ON SCHEMA schema1 TO "john";
> ----- forbid access to 4 columns of Table1
> REVOKE SELECT (ipp , nom_nais , nom , prenom) ON TABLE Table1 FROM "John";
>
> Result :
> The 4 columns are still displayed.
> The "REVOKE SELECT column" doen't work. I manage always to select values
> in the 4 columns.
>
> Can you see why John can still watch the 4 columns ?
> Is a comand missing in this script ?
> Database version is 9.6.
>
> Thanks a lot for your help !
>
> Etienne DECHERF
> DBA
> etienne(dot)decherf-ext(at)aphp(dot)fr
> +33 6 67462246
>
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Vik Fearing | 2018-10-19 19:45:53 | Re: PG V9.6 / REVOKE SELECT columns ON TABLE T1 FROM John |
Previous Message | DECHERF Étienne | 2018-10-19 16:20:35 | PG V9.6 / REVOKE SELECT columns ON TABLE T1 FROM John |