X-Original-To: pgsql-admin@postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id 0397A925030 for ; Fri, 23 May 2003 11:48:14 -0400 (EDT) Received: from developer.postgresql.org ([64.117.224.193]) by localhost (developer.postgresql.org [64.117.224.193:10024]) (amavisd-new) with ESMTP id 71121-06 for ; Fri, 23 May 2003 11:48:00 -0400 (EDT) Received: from wolff.to (wolff.to [66.93.249.74]) by developer.postgresql.org (Postfix) with SMTP id DE41A92502F for ; Fri, 23 May 2003 11:15:02 -0400 (EDT) Received: (qmail 5050 invoked by uid 500); 23 May 2003 15:17:01 -0000 Date: Fri, 23 May 2003 10:17:01 -0500 From: Bruno Wolff III To: David Olbersen Cc: pgsql-admin@postgresql.org Subject: Re: CREATE GROUP question Message-ID: <20030523151701.GC3935@wolff.to> Mail-Followup-To: David Olbersen , pgsql-admin@postgresql.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/331 X-Sequence-Number: 8893 On Thu, May 22, 2003 at 15:04:19 -0700, David Olbersen wrote: > Hello all, > > Looking at the documentation for 7.3 I see that I can create a group and populate it with users at the same time: > > CREATE GROUP foo WITH USER joe, john, jane; > > Looking at the ALTER GROUP and CREATE GROUP documentation I only see "ADD|DROP USER" and "WITH USER" as options, nothing to do with other groups. > > What I'd like to do is create a group which contains groups. > Can I do that at all? It doesn't look like it according to the documentation, and the question isn't raised. I tried searching the list archives at: > http://archives.postgresql.org/search.php > but never got results back as my browser waited forever for ads.area902.com to respond. A quick search on http://groups.google.com also didn't find what I was looking for. The group commands doesn't allow for groups within groups. You can use expressions of the usernames on the group commands so you can't directly pull the data out of the database. What you could do is run a script that extracts group information out of the database and then rebuild the group lists. If you maintain the list in user tables you can even have a trigger that would run a function that would rebuild the groups for you. (You can't put triggers on system tables which is why the data needs to be in a user table to do this.)