RES: [GENERAL] groups

From: "Ricardo J(dot)C(dot)Coelho" <rcoelho(at)px(dot)com(dot)br>
To: "'Remigiusz Sokolowski'" <rems(at)gdansk(dot)sprint(dot)pl>, "pgsql-general(at)postgreSQL(dot)org" <pgsql-general(at)postgreSQL(dot)org>
Subject: RES: [GENERAL] groups
Date: 1999-02-05 10:21:17
Message-ID: 01BE50E0.B4563EC0.rcoelho@px.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dear Remigiusz,

I began with ver.6.4, but I think pg_group has the same fields in 6.3.2.

You can see the struture of all system tables using "man catalogs".

Pg_group has three fields:
groname - the name of group
grosysid - an unique number to represent the group. It's look like GID in
unix.
grolist - an array of user ID belonging to this group. You can get user
ID's with "select * from pg_user".

Pgsql doesn't have a "create group" sql command yet. You need create group
with inserts into pg_group. I'm doing this:

1) Create group with insert: "insert into pg_group values ('mystaff',501);"
2) Create users (create user ..... in group mystaff...) and get their user
ID's from pg_users.
3) Insert user ID's in pg_group: "update pg_group set
grolist='{510,511,512....}' where groname = 'mystaff';"
4) Grant permission to group: "grant ..... on .....to group mystaff;"

Be carefull when you delete the group. First revoke all permission from the
group and change this group of all users. Pgsql has problems with deleted
groups.

Ricardo Coelho.

----- Mensagem original -----
De: Remigiusz Sokolowski [SMTP:rems(at)gdansk(dot)sprint(dot)pl]
Enviada em: Sexta-feira, 5 de Fevereiro de 1999 05:56
Para: pgsql-general(at)postgreSQL(dot)org
Assunto: [GENERAL] groups

Hi!
Problem is simple: how to create and manage groups in ver.6.3.2
I know this is impossible by sql, cause it is implmented in 6.4 version.
Advice to upgrade is now useless, cause my admin don't want to do that -
he has to much work.
Especially I'm interested in good understanding of structure of pg_group
class.
Three fields - first is name of group, so it's simple.
Second one is grosysid - how to find it? If I must to create such a group
in the system and than just use its id?
And the last one field grolist - I suppose it is for users, but I'm not
sure (I could be wrong) - here two questions:
if I suppose well - what is the best way for add, search and delete user
from group
and
if I'm wrong - how users are included in group - what is general concept
for this.
TIA
Rem

-------------------------------------------------------------------*----
--------
Remigiusz Sokolowski e-mail: rems(at)gdansk(dot)sprint(dot)pl * *
-----------------------------------------------------------------*****--
--------

Browse pgsql-general by date

  From Date Subject
Next Message Ricardo J.C.Coelho 1999-02-05 10:27:29 RES: [GENERAL] groups
Previous Message Remigiusz Sokolowski 1999-02-05 08:55:56 groups