RE: BUG #16059: Tab-completion of filenames in COPY commands removes required quotes

Steven Winfield <steven.winfield@cantabcapital.com>

From: Steven Winfield <Steven.Winfield@cantabcapital.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: "pgsql-bugs@lists.postgresql.org" <pgsql-bugs@lists.postgresql.org>
Date: 2019-11-02T22:00:30Z
Lists: pgsql-bugs, pgsql-hackers
>> As per the documentation[1], the COPY command requires the output filename
>> to be single-quoted.
...
>> Note that using the \copy command instead works fine, as filenames do not
>> need to be quoted in that case.

>Yeah, it seems like a bad idea to override the user's choice to write
>a quote, even if one is not formally necessary.  I propose the attached.

Thanks for taking a look at this. It will save me (and I hope many others) from much frustration!

But, to be clear, for the COPY command the single quotes *are* formally necessary, so at the moment tab-completion is turning a valid (partial) invocation into an invalid one.

Best,
Steve.





Commits

  1. Improve psql's tab completion for filenames.

  2. Modernize our readline API a tad.

  3. Add tab completion for EXPLAIN (SETTINGS) in psql