Re: proposal: psql –help reflecting service or URI usage

From: "Euler Taveira" <euler(at)eulerto(dot)com>
To: Paul Förster <paul(dot)foerster(at)gmail(dot)com>, "Mark Dilger" <mark(dot)dilger(at)enterprisedb(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: proposal: psql –help reflecting service or URI usage
Date: 2021-03-01 14:42:16
Message-ID: da641667-ead5-47b5-bca2-2a3b2e9228f7@www.fastmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Mar 1, 2021, at 10:32 AM, Paul Förster wrote:
> still, what is the line length limit? Where do I find it?
We try to limit it to 80 characters but it is not a hard limit. Long
descriptions should certainly be split into multiple lines.

The question is: how popular is service and connection URIs? We cannot
certainly include all possibilities in the --help that's why we have the
documentation. IMO we could probably include "connection string" that accepts 2
formats: (i) multiple keyword - value string and URIs ("service" is included in
the (i)).

Usage:
psql [OPTION]... [DBNAME [USERNAME]|CONNINFO]

or even

Usage:
psql [OPTION]... [DBNAME [USERNAME]]
psql [OPTION]... [CONNINFO]


Connection options:
-h, --host=HOSTNAME database server host or socket directory (default: "local socket")
-p, --port=PORT database server port (default: "9999")
-U, --username=USERNAME database user name (default: "euler")
-w, --no-password never prompt for password
-W, --password force password prompt (should happen automatically)

CONNINFO connection string to connect to (key = value strings
or connection URI)

I don't like the CONNINFO in the connection options. It seems a natural place
but DBNAME and USERNAME aren't included in it. Should we include it too?
Someone can argue that they are self-explanatory, hence, a description is not
necessary.

It might be a different topic but since we are talking about --help
improvements, I have some suggestions:

* an Example section could help newbies to Postgres command-line
tools to figure out how to inform the connection parameters. In this case, we
could include at least 3 examples: (i) -h, -p, -U parameters, (ii) key/value
connection string and (iii) connection URI.
* Connection options could be moved to the top (maybe after General options) if
we consider that it is more important than the other sections (you cannot
probably execute psql without using a connection parameter in production).

--
Euler Taveira
EDB https://www.enterprisedb.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-03-01 14:44:27 Re: macOS SIP, next try
Previous Message Pavel Stehule 2021-03-01 14:31:43 Re: Improvements in prepared statements