Re: disable prompting by default in createuser

From: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: disable prompting by default in createuser
Date: 2012-02-06 01:45:38
Message-ID: CAK3UJRGDvuUMHBXJYAiRVFzCLN5tk9MHtuk+z0Qh5f+eiTD23Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Feb 1, 2012 at 1:13 PM, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
> 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.

Taking a look at the current ./src/bin/scripts executables, I see only
2 out of 9 (`dropdb` and `dropuser`) which have "-i" mean
"--interactive", and `reindexdb` has another meaning for "-i"
entirely. So I'm not sure there's such a clear precedent for having
"-i" mean "--interactive" within our scripts, at least.

> 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.

I think breaking backwards compatibility probably won't fly (and
should probably be handled by another patch, anyway). I guess it's OK
to keep the patch's current behavior, given we are already
inconsistent about what "-i" means.

>> 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.

OK.

Josh

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2012-02-06 04:48:23 Re: 16-bit page checksums for 9.2
Previous Message Shigeru Hanada 2012-02-06 00:28:48 Re: pgsql_fdw, FDW for PostgreSQL server