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?"