Re: disable prompting by default in createuser

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: disable prompting by default in createuser
Date: 2012-02-01 18:13:29
Message-ID: 1328120009.28270.1.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On sön, 2012-01-15 at 18:14 -0500, Josh Kupershmidt wrote:
> I see this patch includes a small change to dropuser, to make the
> 'username' argument mandatory if --interactive is not set, for
> symmetry with createuser's new behavior. That's dandy, though IMO we
> shouldn't have "-i" be shorthand for "--interactive" with dropuser,
> and something different with createuser (i.e. we should just get rid
> of the "i" alias for dropuser).

Well, all the other tools also support -i for prompting. I'd rather get
rid of -i for --inherit, but I fear that will break things as well. I'm
not sure what to do.
>
> Another little inconsistency I see with the behavior when no username
> to create or drop is given:
>
> $ createuser
> createuser: creation of new role failed: ERROR: role "josh" already
> exists
> $ dropuser
> dropuser: missing required argument role name
> Try "dropuser --help" for more information.
>
> i.e. createuser tries taking either $PGUSER or the current username as
> a default user to create, while dropuser just bails out. Personally, I
> prefer just bailing out if no create/drop user is specified, but
> either way I think they should be consistent.

That is intentional long-standing behavior. createdb/dropdb work the
same way.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-02-01 18:17:46 Re: [PATCH] Fix float8 parsing of denormal values (on some platforms?)
Previous Message Robert Haas 2012-02-01 18:10:07 Re: BUG #6425: Bus error in slot_deform_tuple