Re: CREATE GROUP question

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: David Olbersen <DOlbersen(at)stbernard(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: CREATE GROUP question
Date: 2003-05-23 15:17:01
Message-ID: 20030523151701.GC3935@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Thu, May 22, 2003 at 15:04:19 -0700,
David Olbersen <DOlbersen(at)stbernard(dot)com> 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.)

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Jodi Kanter 2003-05-23 15:47:45 Re: upgrade issue
Previous Message Oleg Bartunov 2003-05-23 15:12:14 Re: upgrade issue