Search Postgresql Archives

Re: Grant column level permissions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 8, 2010 at 1:41 PM, dipti shah <shahdipti1980@xxxxxxxxx> wrote:
> Okay. I think I got it but it is not working the way it should. I have given
> select permission on one column but still it is displaying both the columns.
> Could you please tell me what is wrong.
>
>
> techdb=# GRANT SELECT (description), UPDATE (description) ON techtable TO
> user1;
> GRANT
> sysdb=> select * from techtable;
>  number | description
> --------+-------------
> (0 rows)
>
> techdb=>
>
> Thanks.

test=# CREATE USER user1 ENCRYPTED PASSWORD 'test';
CREATE ROLE
test=# CREATE TABLE t1 (col1 int, col2 int);
CREATE TABLE

test=# REVOKE ALL ON t1 FROM user1 ;
REVOKE

test=# GRANT SELECT (col1) ON t1 TO user1;
GRANT

test=# \c test user1
You are now connected to database "test" as user "user1".

test=> select col1 from t1;
 col1
------
(0 rows)

test=> select col2 from t1;
ERROR:  permission denied for relation t1




-- 
Pozdrawiam / Best Regards / Mit freundlichen Grüßen
Michal Pawlikowski
XMPP: misiekbest@xxxxxxxxx
FB: http://tinyurl.com/fbmbst
MS: http://myspace.com/mpawlikowski

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux