Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-interfaces by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group