Re: is there a way to find out if an element is exist

From: Joe Conway <mail(at)joeconway(dot)com>
To: b t <qtboyzz(at)yahoo(dot)com>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: is there a way to find out if an element is exist
Date: 2005-03-03 15:17:34
Message-ID: 42272A8E.3090102@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

b t wrote:
> As part of my project, we have to build a tool similar to phppgadmin,
> I want to find out if a particular is in what group, I used "select
> grolist from pg_group where groname = 'webmaster';" it returned an
> array of user in group "webmaster" I want to find out if a particular
> user is in that array. Thanks in advance

Something like this? (in Postgres 8.0.x)

select usename from pg_user, pg_group
where usesysid = any (grolist) and groname = 'webmaster';

HTH,

Joe

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Berényi Gábor 2005-03-04 00:00:29 Re: [INTERFACES] bcc32.mak for libpq broken? (distro 8.0.0) (fwd)
Previous Message b t 2005-03-03 10:16:29 is there a way to find out if an element is exist in an array