Hey Kretschemer, the has_table_privilege function returns true in following
situation as well which is wrong.
techdb= select pc.relname, pc.relacl from pg_class pc, pg_namespace pn
where pc.relnamespace=pn.oid and pn.nspname='techdb' and
pc.relname='techtable';
relname|
It is strange. If I remove both SELECT and INSERT then works fine but if
either of is there then it doesn't work.
techdb= SELECT has_table_privilege('user1', 'techdb.techtable', 'UPDATE,
DELETE, TRUNCATE, REFERENCES, TRIGGER');
has_table_privilege
-
t
(1 row)
techdb=
Okay I got to know from
http://www.postgresql.org/docs/8.4/interactive/functions-info.html that the
has_table_privilege returns true if any of the listed privilege is held.
Then how can I find whether user has all the specified permissions or not?
From
Hi, I have granted ALL permissions on 'techtable' to 'user1'.
techdb=# select pc.relname, pc.relacl from pg_class pc, pg_namespace pn
where pc.relnamespace=pn.oid and pn.nspname='techdb' and
pc.relname='techtable';
relname | relacl
In response to dipti shah :
Hi, I have granted ALL permissions on 'techtable' to 'user1'.
techdb=# select pc.relname, pc.relacl from pg_class pc, pg_namespace pn where
pc.relnamespace=pn.oid and pn.nspname='techdb' and pc.relname='techtable';
relname |
Thanks Kretschmer but I have seen those function. The below query returns
error but you could see that 'user1' has ALL permissions on table
'techtable'.
techdb=# SELECT has_table_privilege('user1', 'techtable', 'ALL');
ERROR: unrecognized privilege type: ALL
techdb=# select pc.relname,
In response to dipti shah :
Thanks Kretschmer but I have seen those function. The below query returns
error
but you could see that 'user1' has ALL permissions on table 'techtable'.
techdb=# SELECT has_table_privilege('user1', 'techtable', 'ALL');
ERROR: unrecognized privilege type: ALL
Okay. Thanks.
Dipti.
On Thu, Apr 15, 2010 at 3:20 PM, A. Kretschmer
andreas.kretsch...@schollglas.com wrote:
In response to dipti shah :
Thanks Kretschmer but I have seen those function. The below query returns
error
but you could see that 'user1' has ALL permissions on table