Re: disable prompting by default in createuser - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: disable prompting by default in createuser
Date
Msg-id 1328120009.28270.1.camel@vanquo.pezone.net
Whole thread Raw
In response to Re: disable prompting by default in createuser  (Josh Kupershmidt <schmiddy@gmail.com>)
Responses Re: disable prompting by default in createuser
List 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.




pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: some longer, larger pgbench tests with various performance-related patches
Next
From: Tom Lane
Date:
Subject: Re: [PATCH] Fix float8 parsing of denormal values (on some platforms?)