Re: [GENERAL] getting all groups where a user belongs to

2009-09-06 Thread Tom Lane
=?iso-8859-2?Q?Keresztury_Bal=E1zs?= writes: > For example: there is a Service user, called Joe, who belongs to the group > called SER. There is an other one, Kim, who's an administrator (ADM), which > inherits rights from both SER and CEO. My problem is that I need a query, > which returns _all_

Re: [GENERAL] getting all groups where a user belongs to

2009-09-06 Thread Johan Nel
Hi Balázs, Depending the PG Version (pre 8.4) have a look at connectby() in tablefunc. SELECT * FROM connectby('connectby_tree', 'keyid', 'parent_keyid', 'pos', 'row2', 0, '~') AS t(keyid text, parent_keyid text, level int, branch text, pos int); keyid | parent_keyid | level | branch

[GENERAL] getting all groups where a user belongs to

2009-09-06 Thread Keresztury Balázs
hi, I'm currently developing a business software, and I faced a problem just a few days ago. My users are currently using their own credentials for logging in to PostgreSQL server (this makes auditing, logging a lot easier). There are several groups, and the groups can inherit their parents' righ