Re: [PATCHES] Merge pg_shadow && pg_group -- UNTESTED

From: Euler Taveira de Oliveira <eulerto(at)yahoo(dot)com(dot)br>
To: Stephen Frost <sfrost(at)snowman(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] Merge pg_shadow && pg_group -- UNTESTED
Date: 2005-01-22 18:52:05
Message-ID: 20050122185205.16143.qmail@web52610.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Hi Stephen and Hackers,

Moved to -hackers.

> Here's a proof-of-concept pretty much untested (it compiles) patch
> against HEAD for review of the general approach I'm taking to
> merging pg_shadow and pg_group. This is in order to support group
> ownership and eventually roles.

I have to disagree with your model. Roles are not so simple like you
try to describe in your patch. I'm suposing this because your using
role* in all of the 'pg_shadow'.
What's Role? A set of relations with their respective privileges and
a set of users and/or roles.

Sometime ago, I drafted a model I think it can be useful. Here it is:

Another catalog relation named 'pg_role' with the following members:
- rolsysid (role id)
- rolname (role name)
- rolowner (role owner)
- rolmembs[] (list of users that belong to the role)
- rolrels[] (list of relations + their permissions)
- hasroles (have dependent roles?)

where:

rolmembs[] is:
- userid (user id or group id or role id)

rolrels[] is:
- relid (relation oid)
- rs_privs (privileges)

What do we do with 'groups'? Well, we can have three categories of
object owners: users, groups and roles. So the 'group owner' can be
implemented with this model.

What about dependent roles? It will be in 'pg_depend'.

Advantages:
1. Don't require changing the actual catalog model. Just an increment.
2. Can't introduce too much overhead. Once roles are in another catalog
table, we need to search it only if it's required.
3. All serious commercial databases have it. And of course, PostgreSQL
community want it too. :-)

Disadvantages:
1. Some overhead when checking for roles and dependent roles.

Comments and/or ideas?

=====
Euler Taveira de Oliveira
euler[at]yahoo_com_br

__________________________________________________
Converse com seus amigos em tempo real com o Yahoo! Messenger
http://br.download.yahoo.com/messenger/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Buttafuoco 2005-01-22 19:24:52 Re: pg_clog problem (PG version 7.4.5)
Previous Message Tom Lane 2005-01-22 18:41:04 Re: pg_clog problem (PG version 7.4.5)

Browse pgsql-patches by date

  From Date Subject
Next Message Stephen Frost 2005-01-22 19:49:06 Re: [PATCHES] Merge pg_shadow && pg_group -- UNTESTED
Previous Message Neil Conway 2005-01-22 13:24:50 Re: vacuum hint on elog