AW: [HACKERS] Re: [QUESTIONS] groups of users

Поиск
Список
Период
Сортировка
От Andreas Zeugswetter
Тема AW: [HACKERS] Re: [QUESTIONS] groups of users
Дата
Msg-id 01BD78D4.201726F0@zeugswettera.user.lan.at
обсуждение исходный текст
Ответы Re: AW: [HACKERS] Re: [QUESTIONS] groups of users  (The Hermit Hacker <scrappy@hub.org>)
Список 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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Meskes
Дата:
Сообщение: Re: [HACKERS] OK to send e-mail?
Следующее
От: Michael Meskes
Дата:
Сообщение: initdb still doesn't work