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.