Re: User/Groups

From: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
To: Michael Fork <mfork(at)toledolink(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: User/Groups
Date: 2000-04-04 10:45:13
Message-ID: Pine.LNX.3.96.1000404124011.6641A-100000@ara.zf.jcu.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


On Mon, 3 Apr 2000, Michael Fork wrote:

> I am trying to populate a select box on a form with all users in the group
> with the sysid of 1 using the following query:
>
> SELECT usename FROM pg_user, pg_group WHERE pg_user.usesysid IN
> pg_group.grolist AND pg_group.grosysid = 1;
>
> however, everytime I run it I recieve the following error:
>
> ERROR: parser: parse error at or near "pg_group"
>
> which leads me to belive that the IN operator is not correct, is there
> another one that I should be using? Thanks in advance.

In the postgreSQL contrib tree is modul (array_iterator) with operators
for arrays.

A solution for you:

SELECT usename
FROM pg_user, pg_group
WHERE pg_group.grolist *= pg_user.usesysid AND pg_group.grosysid = 1;

Karel

/* ----------------
* Karel Zak * zakkr(at)zf(dot)jcu(dot)cz * http://home.zf.jcu.cz/~zakkr/
* C, PostgreSQL, PHP, WWW, http://docs.linux.cz
* ----------------
*/

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Larry ganga giri 2000-04-04 11:42:15 Prob in installing DBD::Pg 0.93
Previous Message Peter Eisentraut 2000-04-04 10:34:04 Re: Outer-joins