Re: Extra functionality to createuser

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Christopher Browne <cbbrowne(at)gmail(dot)com>
Cc: PostgreSQL Mailing Lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Extra functionality to createuser
Date: 2013-09-27 11:01:28
Message-ID: CA+TgmoZpa7kaWs7R-me+i2+YZApm20OwwqULcBO25O2FrVsK+Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Sep 26, 2013 at 1:04 PM, Christopher Browne <cbbrowne(at)gmail(dot)com> wrote:
> 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?

I'd be inclined to favor a patch implementing this.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2013-09-27 11:12:21 Re: Re: Request for Patch Feedback: Lag & Lead Window Functions Can Ignore Nulls
Previous Message Robert Haas 2013-09-27 10:56:52 Re: backup.sgml-cmd-v003.patch