Thread: Operator ~ on type aclitem in pgsql 7.2

Operator ~ on type aclitem in pgsql 7.2

From
karin probost
Date:
Iam testing postgresql 7.2

In postgres 6.5 i used the ~ Operator on type aclitem to search:

has user xyz the permisssion x on table x ?

This is useful to disable update-buttons in the GUI for users

who have only read-permissions.

with the following command as example

select       relname       , relacl
from       pg_class
where       relacl ~ 'nobody=r'::aclitem

and
       relname = 'tab1'

;

In 7.2 this command only is successful if r is the only permission

of nobody on the table. To show the effect the following commands:
relname |               relacl
---------+------------------------------------tab1    | {=,probost=arwdRxt,nobody=r}tab2    |
{=,probost=arwdRxt,nobody=arwdRxt}tab3   | {=,probost=arwdRxt,nobody=r}
 
(3 rows)

select  relname       , relacl
from       pg_class
where       relkind ='r'
and       relname !~ '^pg_'relname |            relacl
---------+------------------------------tab1    | {=,probost=arwdRxt,nobody=r}tab3    | {=,probost=arwdRxt,nobody=r}
(2 rows)

select       relname       , relacl
from       pg_class
where       relacl ~ 'nobody=r'::aclitem

;

May I change the syntax of the sql ?

is this an error ?

is there another possibility to reply to the above question ?

--
MfG

-------------------------------------------------------------------------
- Karin Probost
- Bergische Universitaet Wuppertal
- RECHENZENTRUM  Raum P-.09.05
- Gaussstr. 20
- D-42097 Wuppertal
- Germany
-
- Tel. : +49 -202 /439 3151 ,Fax -2910
--Email: probost@uni-wuppertal.de
--Home : http://www.hrz.uni-wuppertal.de/hrz/personen/k_probost.html
-------------------------------------------------------------------------