Re: Extra functionality to createuser - Mailing list pgsql-hackers

From Christopher Browne
Subject Re: Extra functionality to createuser
Date
Msg-id CAFNqd5XwvmWZbqEFy=GfsSnDjaxry+9OGrtXHzv4k9KhEmyqaA@mail.gmail.com
Whole thread Raw
In response to Re: Extra functionality to createuser  (Sameer Thakur <samthakur74@gmail.com>)
Responses Re: Extra functionality to createuser  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
On Thu, Nov 14, 2013 at 5:41 AM, Sameer Thakur <samthakur74@gmail.com> wrote:
> So i think -g option is failing

Right you are.

I was missing a "g:" in the getopt_long() call.

Attached is a revised patch that handles that.

And it behaves better:
postgres@cbbrowne ~/p/s/b/scripts> ./createuser -g purge_role -U
postgres newuser4
postgres@cbbrowne ~/p/s/b/scripts> pg_dumpall -g | grep newuser4
CREATE ROLE newuser4;
ALTER ROLE newuser4 WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB
LOGIN NOREPLICATION;
GRANT purge_role TO newuser4 GRANTED BY postgres;

--
When confronted by a difficult problem, solve it by reducing it to the
question, "How would the Lone Ranger handle this?"

Attachment

pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Assertions in PL/PgSQL
Next
From: Pavel Stehule
Date:
Subject: "union all" query consumes all memory