From qtboyzz@yahoo.com Thu Mar 3 10:16:32 2005 X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 9AFB352A8D for ; Thu, 3 Mar 2005 10:16:32 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 13743-04 for ; Thu, 3 Mar 2005 10:16:30 +0000 (GMT) Received: from web61007.mail.yahoo.com (web61007.mail.yahoo.com [216.155.196.96]) by svr1.postgresql.org (Postfix) with SMTP id E173852AAD for ; Thu, 3 Mar 2005 10:16:27 +0000 (GMT) Received: (qmail 76784 invoked by uid 60001); 3 Mar 2005 10:16:29 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=0RLW5sSIn5me9smrZFhSX8v79IEt3WatC2tj/D7NMarfB1mkMloH3EH6Tuz/roG3WRvkUmOqNRNHWV6St31MV4XoyYuIL9nmZgfzUboIqN0rngm4nblekyPIRLrXkmsU5bzjsZyuZVu0Uuk8kfH5wpkB9UaH3uEmTYmIqT44vsI= ; Message-ID: <20050303101629.76782.qmail@web61007.mail.yahoo.com> Received: from [68.120.71.7] by web61007.mail.yahoo.com via HTTP; Thu, 03 Mar 2005 02:16:29 PST Date: Thu, 3 Mar 2005 02:16:29 -0800 (PST) From: b t Subject: is there a way to find out if an element is exist in an array To: pgsql-interfaces@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-966088777-1109844989=:73373" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.364 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, HTML_20_30, HTML_MESSAGE X-Spam-Level: * X-Archive-Number: 200503/4 X-Sequence-Number: 5333 --0-966088777-1109844989=:73373 Content-Type: text/plain; charset=us-ascii 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 -Brian --------------------------------- Celebrate Yahoo!'s 10th Birthday! Yahoo! Netrospective: 100 Moments of the Web --0-966088777-1109844989=:73373 Content-Type: text/html; charset=us-ascii
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
-Brian
 


Celebrate Yahoo!'s 10th Birthday!
Yahoo! Netrospective: 100 Moments of the Web --0-966088777-1109844989=:73373-- From mail@joeconway.com Thu Mar 3 15:17:36 2005 X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id AB59F52AAD for ; Thu, 3 Mar 2005 15:17:36 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 99413-02 for ; Thu, 3 Mar 2005 15:17:31 +0000 (GMT) Received: from joeconway.com (wsip-24-249-201-67.sd.sd.cox.net [24.249.201.67]) by svr1.postgresql.org (Postfix) with ESMTP id 3AB0152AA6 for ; Thu, 3 Mar 2005 15:17:30 +0000 (GMT) Received: from [206.19.64.3] (account jconway HELO [172.16.1.115]) by joeconway.com (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 2617409; Thu, 03 Mar 2005 08:17:50 -0800 Message-ID: <42272A8E.3090102@joeconway.com> Date: Thu, 03 Mar 2005 07:17:34 -0800 From: Joe Conway User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20040921 X-Accept-Language: en-us, en MIME-Version: 1.0 To: b t Cc: pgsql-interfaces@postgresql.org Subject: Re: is there a way to find out if an element is exist References: <20050303101629.76782.qmail@web61007.mail.yahoo.com> In-Reply-To: <20050303101629.76782.qmail@web61007.mail.yahoo.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.047 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200503/5 X-Sequence-Number: 5334 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