Re: Renaming some binaries - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Renaming some binaries
Date
Msg-id 20160826202911.GA320593@alvherre.pgsql
Whole thread Raw
In response to Re: Renaming some binaries  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-hackers
Simon Riggs wrote:
> On 26 August 2016 at 18:26, Euler Taveira <euler@timbira.com.br> wrote:
> 
> > I'm bringing this $subject into discussion again. Historically, we are
> > carrying binary names that have been confused newbies. createuser is the
> > worst name so for. Also, names like createdb, initdb, reindexdb, and
> > droplang does not suggest what product it is referring to. Adding a
> > prefix (pg_, pg, ...) would 'make things clear'. If we have a consensus
> > about this change, I suggest renaming the following binaries:
> Why not just remove them all and change the docs to suggest using
> 
> psql -c "CREATE DATABASE foo"

I agree that some of these commands are redundant, and that we seem to
have them just because we can, not because they provide useful
functionality:
createdb createlang createuser dropdb droplang dropuser

I would rather have a single command that can do all those actions.
We could have things like pg_ctl createuser

I agree with Simon that many "serious users" would not be using
the shell to implement this functionality, but something higher-level (a
GUI, some web app) that's going to go through SQL instead.  Still, for
ad-hoc admin tasks it seems convenient to have the shell interface.

Nowadays git and many other programs have a model where a single command
(git) can call a number of different binaries which are not in PATH
(/usr/lib/git-core in my installation).  We could do something similar,
where little else apart from pg_ctl, pg_dump, pgbench are in path, and
most binaries are in some hidden binary directory known to pg_ctl.

pg_ctl vacuum -j4 <database>


(Personally, I very often have postmaster running on its own terminal
with output to stderr.  It'd be a little sad to lose that functionality,
but what value does it offer to regular users?  I can script my way
around its lack, if needed.)

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Renaming of pg_xlog and pg_clog
Next
From: Tomas Vondra
Date:
Subject: Re: Renaming some binaries