Extra functionality to createuser

Поиск
Список
Период
Сортировка
От Christopher Browne
Тема Extra functionality to createuser
Дата
Msg-id CAFNqd5Vf5wjX0Pm+1n5mAwgrnNbk3KfUv09s1etMb4A332JRKg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Extra functionality to createuser  (Robert Haas <robertmhaas@gmail.com>)
Re: Extra functionality to createuser  (Christopher Browne <cbbrowne@gmail.com>)
Список pgsql-hackers
Sitting on my todo list for a while has been to consider the idea of
adding a bit of additional functionality to createuser.

One of the functions of CREATE ROLE is to associate the role with
other roles, thus...
  create role my_new_user nosuperuser nocreatedb login   IN ROLE app_readonly_role, app2_writer_role;

That isn't something that I can do using createuser; to do that, I
would need to submit two requests separately:
  PGUSER=postgres createuser -D -S -l my_new_user  PGUSER=postgres psql -c "grant app_readonly_role, app2_writer_role
to my_new_user;"

I could certainly change over to using psql to do all the work, but it
would be rather nice if createuser had (say) a "-g" option which
allowed specifying the set of roles that should be assigned.

Thus, the above commands might be replaced by:  PGUSER=postgres createuser -D -S -l -g
app_readonly_role,app2_writer_role my_new_user

Would this be worth adding to the ToDo list?
-- 
When confronted by a difficult problem, solve it by reducing it to the
question, "How would the Lone Ranger handle this?"



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Minmax indexes
Следующее
От: Ivan Lezhnjov IV
Дата:
Сообщение: Re: backup.sgml-cmd-v003.patch