Re: psql and output from \? - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: psql and output from \?
Date
Msg-id Pine.LNX.4.30.0202251844250.836-100000@peter.localdomain
Whole thread Raw
In response to psql and output from \?  (Ian Barwick <barwick@gmx.net>)
Responses Re: psql and output from \?  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Ian Barwick writes:

>   Appended is a list of relevant backslash commands, their current
>   description as produced by  \?, the respective manpage description (or
>   first part thereof) and suggested replacment for the \? description.
>   Assumption is that square brackets - as used elsewhere within the
>   \? output and the manpage documentation - imply optional parameters.

Nicely observed.  Please send in a patch.  Accurate documentation is
important.

> psql \? new:
> \C [ TITLE ]  set table title (or unset with no arguments)

I don't think we use spaces between the brackets and the text anywhere
else in console-formatted output, so we might not want to start here.

Also, the part in the parentheses is ambiguous.  Maybe "(without
arguments: unset)".

> psql \? new:
> \d [ RELATION ] describe relation (table, view, index or sequence)

Comma before "or".

> psql \? new:
> \e [ FILENAME ]  edit the current query buffer or file with external editor

Maybe drop the "current".  (This was not introduced by you, but you might
as well do it.)


Something that's also annoyed me for a while is that the PLACEHOLDER
strings are inconsistent in whether they describe the data type or the
semantics of the argument.  I think the data type is ultimately more
useful, as the semantics come from the documentation string by definition.

So instead of \C TITLE maybe better \C STRING, and instead of \d TABLE use
\d IDENTIFIER (or maybe NAME).  The latter has two advantages:  First
you're not passing \d a table descriptor, if there was such a thing.  And
second, it informs the user that the SQL identifier quoting rules will
apply to the argument.  I guess FILENAME and DIRNAME are ok as "data
types", but all the other stuff can go, I think.

-- 
Peter Eisentraut   peter_e@gmx.net



pgsql-hackers by date:

Previous
From: Ian Barwick
Date:
Subject: psql and output from \?
Next
From: Thomas Lockhart
Date:
Subject: Re: More time zones