Re: Doc patch on psql output formats

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: "Daniel Verite" <daniel@manitou-mail.org>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2018-11-06T15:03:14Z
Lists: pgsql-hackers
"Daniel Verite" <daniel@manitou-mail.org> writes:
> psql's documentation has this mention about output formats:
>  "Unique abbreviations are allowed. (That would mean one letter is enough.)"

> but "one letter is enough" is not true since 9.3 that added
> "latex-longtable" sharing the same start as "latex", and then 
> 9.5 added "asciidoc" with the same first letter as "aligned".

Yeah, that text has clearly outstayed its welcome.

> When a non-unique abbreviation is used, psql uses the first
> match in an arbitrary order defined in do_pset() by
> a cascade of pg_strncasecmp().

Ugh.  Should we not fix the code so that it complains if there's
not a unique match?  I would bet that the code was also written
on the assumption that any abbrevation must be unique.

			regards, tom lane


Commits

  1. Fix breakage of "\pset format latex".

  2. Make psql's "\pset format" command reject non-unique abbreviations.

  3. Doc: remove claim that all \pset format options are unique in 1 letter.

  4. Reorganize format options of psql in alphabetical order