Re: Confusing long option in pg_receivexlog/basebackup/dumpall

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Confusing long option in pg_receivexlog/basebackup/dumpall
Date: 2013-05-02 05:54:01
Message-ID: 5181FF79.3090902@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 02.05.2013 08:43, Pavan Deolasee wrote:
> Hi All,
>
> While looking at the help message of pg_basebackup, I got a bit confused by
> it. It looks something like this:
>
> Connection options:
> -d, --dbname=CONNSTR connection string
>
> So the long option says "--dbname" which is not really what its expecting.
> The same issue also applies to pg_receivexlog and pg_dumpall. I wonder if
> this is a well thought out user API or just an oversight when we chose to
> use "-d" to pass connection string to the command, In fact, I would have
> avoided using either -d or --dbname because they are used very frequently
> in other commands to mean something else.

It's deliberate, although I admit it's confusing. The manual explains it:

> -d connstr
> --dbname=connstr
>
> Specifies parameters used to connect to the server, as a connection string. See Section 31.1.1 for more information.
>
> The option is called --dbname for consistency with other client applications, but because pg_basebackup doesn't connect to any particular database in the cluster, database name in the connection string will be ignored.

In other tools too, like psql, you can pass a connection string with
-d/--dbname, which is why I thought it would be best to use the same
option for passing a connection string to pg_basebackup/pg_dumpall too.

See discussion at
http://www.postgresql.org/message-id/512520FE.6050701@vmware.com. If you
have any better ideas, I'm all ears...

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2013-05-02 06:11:14 Re: Confusing comment in xlog.c or am I missing something?
Previous Message Pavan Deolasee 2013-05-02 05:43:59 Confusing long option in pg_receivexlog/basebackup/dumpall