I need to find out a quick way to check which groups a user
is member of.
In the pg_group table each group row has an array of
userids of the members of the group.
At the moment I am selecting all the rows than
searching in each array for the id of the user
I am looking for.
There should be
Hi,
You need create a function use PLPGSQL(or PL/Perl) say:
ismember(groupname,username) return bool
since select grolist from pg_group where proname=groupname will return
you an array,
you can use a loop compare each element with the id from usesysid from
pg_user which match username.