| From: | Andreas Zeugswetter <andreas(dot)zeugswetter(at)telecom(dot)at> | 
|---|---|
| To: | "'The Hermit Hacker'" <scrappy(at)hub(dot)org> | 
| Cc: | "'hackers(at)postgresql(dot)org'" <hackers(at)postgresql(dot)org> | 
| Subject: | AW: [HACKERS] Re: [QUESTIONS] groups of users | 
| Date: | 1998-05-06 07:48:23 | 
| Message-ID: | 01BD78D4.201726F0@zeugswettera.user.lan.at | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
Just tried this out, and we have a bug here:
simply not implemented, not a bug.
template1=> create user tester in group pg_user;
CREATE USER
so "pg_user" is supposed to be a new group name (not a good name)
The group "pg_user" must already exist. But since the "in group" clause
is currently ignored, no error shows up.
template1=> select * from pg_group;
groname|grosysid|grolist
-------+--------+-------
(0 rows)
template1=> select * from pg_user; 
usename|usesysid|usecreatedb|usetrace|usesuper|usecatupd|passwd  |valuntil                    
-------+--------+-----------+--------+--------+---------+--------+----------------------------
pgsql  |    1005|t          |t       |t       |t        |********|Sat Jan 31 02:00:00 2037 AST
scrappy|      10|t          |t       |t       |t        |********|                            
tester |    1006|f          |t       |f       |t        |********|                            
(3 rows)
template1=> insert into pg_group values ('test',0,'{scrappy}');
ERROR:  pg_atoi: error in "scrappy": can't parse "scrappy"
template1=> insert into pg_group values ('test',0,'{10}');
INSERT 18497 1
you created a group "test" with one user ("scrappy") as it's only member. 
This is currently the only way to do it.
template1=> create user test in group pg_user;
ERROR:  defineUser: user "test" has already been created
I think this is because of the SQL92 spec. that user and group names have to be
distinct. (no user and group with same name)
template1=> create user test in group test;   
ERROR:  defineUser: user "test" has already been created
template1=> select * from pg_user;
usename|usesysid|usecreatedb|usetrace|usesuper|usecatupd|passwd  |valuntil                    
-------+--------+-----------+--------+--------+---------+--------+----------------------------
pgsql  |    1005|t          |t       |t       |t        |********|Sat Jan 31 02:00:00 2037 AST
scrappy|      10|t          |t       |t       |t        |********|                            
tester |    1006|f          |t       |f       |t        |********|                            
(3 rows)
If I do a different usename ('beater'), it creates fine, but doesn't go 
anywhere as far as pg_group...
If nobody is working on this area of the code, I'll use it as my personal
starting point into it...just let me know...
I think a "create group" would be a very valuable contribution. 
(Make role an alias for group, to be SQL92 conformant)
Andreas
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Michael Meskes | 1998-05-06 12:31:44 | initdb still doesn't work | 
| Previous Message | Michael Meskes | 1998-05-06 07:08:38 | Re: [HACKERS] OK to send e-mail? |