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


From: Francisco Reyes <fran(at)reyes(dot)somos(dot)net>
To: Nabil Sayegh <nsmail(at)sayegh(dot)de>
Cc: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: CUG
Date: 2001-02-03 19:16:35
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
On Sat, 3 Feb 2001, Nabil Sayegh wrote:

> what would be the best way to implement a closed user group in an app
> with postgresql ?

You really need to give us more details.
If it is something like a forum/bulleting board/ or something like
egroups, then your best bet by far is to start off existing code. Don't
see the point on re-inventing the wheel from scratch.

> Groups should be containable in other groups (AFAIK this is not possible
> in  postgresql's group management).

The groups managmenent of the database is to manage rights. I really don't
think you want to use db groups for your projects.  I even think you won't
need more than one DB user for the project.

> Up to now I had my own user/group management (one col per table
> indicating the  group which has read-access).
> It was easy to check permissions in my app and in WHERE clauses.
> But now I need groups of groups which needs some kind of recursion.

I see no problems with that.
There are several not too difficult ways to implement this, but you need
to give us more details. I personally don't see the benefit AT ALL on
using recursion. If someone needs access to different things which
different groups have access to, then you add that person to the different
groups which have ther proper rights.

Perhaps I don't know enough about what you are trying to do, but recursion
does not sound like the right thing to use.

> Q: Before I do this, I would like to know whether this is the correct
> approach.

I don't think so.

> Q: Should I use the built in user/group features ? (If not: What are
> they there for?)

To determine who has rights and what type of rights to particular tables.

> Q: Are there other mechanisms to handle tree-structures ? With properly
> defined REFERENCES this should be possible (?)

Don't really see why you would need tree structures for an access policy
type of databases.

 The only hints on recursions
> and postgresql where features to AVOID recursion :((((((

Right now I can not think of many instances where recursion can make your
life easier in databases.

Moreover from what you are describing it sounds like your design is not
clear in terms of what each part should do. A database is not a
programming environment. It is a place to efficiently store and access
data. Recursion is a programming concept which can be implemented in many
different ways and without direct connection to how data is stored.

Again if you give us more info about your goals we may be able to provide
with better feedback.

In response to

  • CUG at 2001-02-03 16:48:28 from Nabil Sayegh


  • Re: CUG at 2001-02-03 21:11:12 from Nabil Sayegh

pgsql-novice by date

Next:From: Nabil SayeghDate: 2001-02-03 21:11:12
Subject: Re: CUG
Previous:From: Francisco ReyesDate: 2001-02-03 19:06:09
Subject: RE: [NOVICE] RE: Sizing of LARGE databases.

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