X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 54A599FA218 for ; Sat, 20 May 2006 13:05:01 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 48563-05 for ; Sat, 20 May 2006 13:04:52 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from coe.tamu.edu (edsun.coe.tamu.edu [165.91.232.6]) by postgresql.org (Postfix) with ESMTP id 555C69FA279 for ; Sat, 20 May 2006 13:04:52 -0300 (ADT) Received: (from root@localhost) by bruner.coe.tamu.edu (8.13.1/8.13.1) id k4KG3p9b021378; Sat, 20 May 2006 11:03:51 -0500 Received: from coe.tamu.edu (coe.tamu.edu [165.91.232.6]) by coe.tamu.edu (8.11.7p2+Sun/8.12.11) with ESMTP id k4KG3Cc06362; Sat, 20 May 2006 11:03:12 -0500 (CDT) Date: Sat, 20 May 2006 11:02:59 -0500 (CDT) From: "Ben K." To: "ashok@kalculate.com" cc: pgsql-admin@postgresql.org Subject: Re: find out all users under specific user In-Reply-To: <380-22006541817540109@M2W005.mail2web.com> Message-ID: References: <380-22006541817540109@M2W005.mail2web.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: by AMaViS 0.3.12 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/282 X-Sequence-Number: 21814 > I want to find out all the users under a specific user. > postgres is a superuser of postgresql, > under in postres user i made one user ABC and > under this ABC user i made XYZ,MNO,IJK users. > > Now i want to find out all the users, which r exist > under in ABC user so what is the query for it? select relname, array_to_string(relacl,',') as acl from pg_class where array_to_string(relacl,',') ~ '/ABC[,$]'; HTH Ben K. Developer http://benix.tamu.edu