On Thu, Apr 8, 2010 at 1:41 PM, dipti shah <shahdipti1980@gmail.com> 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@gmail.com
FB: http://tinyurl.com/fbmbst
MS: http://myspace.com/mpawlikowski