Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id AE843420B3A for ; Wed, 1 Feb 2012 17:50:09 -0400 (AST) Received: from mta.eranet.pl ([213.158.194.142]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Rsi47-0002Po-Is for pgsql-bugs@postgresql.org; Wed, 01 Feb 2012 21:50:08 +0000 MIME-version: 1.0 Received: from mail2z.era.isp ([10.251.142.80]) by eranet.pl (Sun Java(tm) System Messaging Server 6.3-8.04 (built Jul 29 2009; 32bit)) with ESMTP id <0LYQ00JI7HZ6EPH0@eranet.pl> for pgsql-bugs@postgresql.org; Wed, 01 Feb 2012 22:49:54 +0100 (CET) Received: from wlas3 ([192.168.90.45]) by eranet.pl (Sun Java(tm) System Messaging Server 6.3-8.04 (built Jul 29 2009; 32bit)) with ESMTP id <0LYQ00J7HHZ6XC50@eranet.pl>; Wed, 01 Feb 2012 22:49:54 +0100 (CET) Date: Wed, 01 Feb 2012 22:49:54 +0100 (CET) From: "bdmytrak@eranet.pl" To: tgl@sss.pgh.pa.us Cc: pgsql-bugs@postgresql.org Message-id: <8564163.114.1328132994056.JavaMail.omnix03@wlas3> Subject: Re: BUG #6421: Revoke column level privilage X-Priority: 3 X-Pg-Spam-Score: -0.9 (/) Content-Type: multipart/alternative; boundary="Boundary_(ID_eTgIhfuxUVYqzrLmxgtMuA)" X-Archive-Number: 201202/23 X-Sequence-Number: 32366 --Boundary_(ID_QZtR+gHe88y7w0Yd5sZPnA) Content-type: multipart/alternative; boundary="Boundary_(ID_eTgIhfuxUVYqzrLmxgtMuA)" --Boundary_(ID_eTgIhfuxUVYqzrLmxgtMuA) Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7BIT Thanks for Your answer. Works as designed - I have to get used. Please notice the return message from REVOKE ALL command: myDatabase=# REVOKE ALL("Column1") ON public."tblTest" FROM public; REVOKE myDatabase=# \dp public."tblTest" Access privileges Schema | Name | Type | Access privileges | Column access privileges --------+---------+-------+----------------------------+-------------------------- public | tblTest | table | postgres=arwdDxt/postgres +| Column1: + | | | otherUser=ar*wdxt/postgres | =r/otherUser (1 row) return message is REVOKE, but privileges are not really revoked ? there should be at least warning message generated. REVOKE...CASCADE works fine. AFAIK SQL Standard defines GRANTED BY. I haven't found it in PosgtreSQL documentation, so assume it is not implemented. I think it is good idea to imlement it, this could help in that case. Regards, Bartek --- Oryginalna wiadomo?? --- Od: Tom Lane [mailto: tgl@sss.pgh.pa.us] Wys?ane: Tuesday, January 31, 2012 03:03 AM Do: bdmytrak@eranet.pl Kopia: pgsql-bugs@postgresql.org Temat: Re: [BUGS] BUG #6421: Revoke column level privilage bdmytrak@eranet.pl writes: > Cannot revoke column level privilages. AFAICS this is not a bug, and it's certainly not specific to column-level privileges. You had "postgres" grant some privileges to "otherUser" with grant option, and then had "otherUser" re-grant those privileges to public. "postgres" cannot revoke the re-grant directly. You can have it revoke "otherUser"'s grant option. (I think this will require the CASCADE keyword if there are dependent privileges that have to be revoked in consequence.) Or you can log in as "otherUser" and revoke the privilege grants made by that role. This is per design and AFAIK it's per the SQL standard's requirements. There's a lot of fine print in the Notes sections of the GRANT and REVOKE reference pages, which you might find helpful. regards, tom lane Pozdrawiam, Bartek --Boundary_(ID_eTgIhfuxUVYqzrLmxgtMuA) Content-type: text/html; charset=utf-8 Content-transfer-encoding: quoted-printable

Thanks for Your answer.

Works as designed - I have to get used.

Please notice the return message from REVOKE ALL command:

myDatabase=3D# REVOKE ALL("Column1") ON public."tblTest" FROM public;

REVOKE

myDatabase=3D# \dp public."tblTest"

= Access privileges

Schema | Name | Type | Access privileges | Column access

privileges

--------+---------+-------+----------------------------= +--------------------------

public | tblTest | table | postgres=3DarwdDxt/postgres +| Column1: =20

+

| | | otherUser=3Dar*wdxt/postgres | =3Dr/otherUser

(1 row)

return = message is REVOKE, but privileges are not really revoked – there should be at = least warning message generated. REVOKE...CASCADE works fine.

AFAIK SQL Standard defines GRANTED BY. I haven't found it in PosgtreSQL documentation, so assume it is not implemented. I think it is good idea to imlement it, this could help in that case.

Regards,

Bartek


--- Oryginalna wiadomo=C5=9B=C4=87 ---


Od: Tom Lane [mailto= : tgl@sss.pgh.pa.us]
Wys=C5=82ane: Tuesday, January 31, 2012 03:03 AMDo: bdmytrak@eranet.pl
Kopia: pgsql-bugs@postgresql.org
Temat: Re:= [BUGS] BUG #6421: Revoke column level privilage
bdmytrak@eranet.pl writ= es:
> Cannot revoke column level privilages.

AFAICS this is no= t a bug, and it's certainly not specific to
column-level privileges. Yo= u had "postgres" grant some privileges to
"otherUser" with grant option,= and then had "otherUser" re-grant those
privileges to public. "postgre= s" cannot revoke the re-grant directly.
You can have it revoke "otherUse= r"'s grant option. (I think this will
require the CASCADE keyword if th= ere are dependent privileges that
have to be revoked in consequence.) O= r you can log in as "otherUser"
and revoke the privilege grants made by = that role. This is per design
and AFAIK it's per the SQL standard's req= uirements.

There's a lot of fine print in the Notes sections of the = GRANT and
REVOKE reference pages, which you might find helpful.

= =09=09=09regards, tom lane


Pozdrawiam,
Bartek
= --Boundary_(ID_eTgIhfuxUVYqzrLmxgtMuA)-- --Boundary_(ID_QZtR+gHe88y7w0Yd5sZPnA)--