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-25T23:01:26Z
Lists: pgsql-hackers
Attachments
- pset-format-latex-fix.patch (text/x-diff) patch
"Daniel Verite" <daniel@manitou-mail.org> writes: > Tom Lane wrote: >> Pushed. (I simplified the code a bit by using just one state variable, >> and also made the error message more verbose.) > Thanks! I noticed while poking at the csv patch that we'd outsmarted ourselves with this one. As of HEAD, it's impossible to select latex output format at all: regression=# \pset format latex \pset: ambiguous abbreviation "latex" matches both "latex" and "latex-longtable" We could fix that by adding a special case to accept an exact match immediately. However, that would still leave us in a situation where "latex" can never be abbreviated at all, which does not seem very nice (not to mention not being backwards-compatible). Instead I propose treating "latex-longtable" as a special case, as attached. With this code, "l", "la", up through "latex" are all accepted as "latex", while "latex-" through "latex-longtable" are accepted as "latex-longtable". This has less ideological purity than one could wish, but it's backwards compatible and arguably a lot more user-friendly than what we'd have if we insist on an exact match for "latex". In future, let's reject any proposal to invent switch or option names such that one is a prefix of another. regards, tom lane
Commits
-
Fix breakage of "\pset format latex".
- a7eece4fc9a4 12.0 landed
-
Make psql's "\pset format" command reject non-unique abbreviations.
- eaf746a5b85a 12.0 landed
-
Doc: remove claim that all \pset format options are unique in 1 letter.
- b8182d6293d9 11.2 landed
- 6a312b2587c6 9.4.21 landed
- 5f2937734cd1 10.7 landed
- 51eaaafb850b 12.0 landed
- 44dc82690d4e 9.5.16 landed
- 033d45a1008f 9.6.12 landed
-
Reorganize format options of psql in alphabetical order
- add9182e5908 12.0 cited