| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> | 
|---|---|
| To: | steven(dot)winfield(at)cantabcapital(dot)com | 
| Cc: | pgsql-bugs(at)lists(dot)postgresql(dot)org | 
| Subject: | Re: BUG #16059: Tab-completion of filenames in COPY commands removes required quotes | 
| Date: | 2019-11-02 21:14:20 | 
| Message-ID: | 30313.1572729260@sss.pgh.pa.us | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-bugs pgsql-hackers | 
PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> As per the documentation[1], the COPY command requires the output filename
> to be single-quoted.
> However, when using psql, a partial COPY command such as this...
> COPY pg_catalog.pg_class TO '/usr
> ...will, on hitting TAB, be converted to this...
> COPY pg_catalog.pg_class TO /usr/
> ...requiring the user to move the cursor back to re-insert the single quote
> before finishing the command and executing.
> The issue seems to be somewhere around here[2], where complete_from_files[3]
> is used to suggest replacements - that function strips quotes from the
> existing (partial) filename but doesn't put them back unless quote_if_needed
> is true (which I guess it isn't, unless there is a space in the filename for
> example).
> 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.
regards, tom lane
| Attachment | Content-Type | Size | 
|---|---|---|
| fix-bug-16059.patch | text/x-diff | 3.2 KB | 
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Steven Winfield | 2019-11-02 22:00:30 | RE: BUG #16059: Tab-completion of filenames in COPY commands removes required quotes | 
| Previous Message | Alexey Ermakov | 2019-11-02 17:30:45 | Re: BUG #16016: deadlock with startup process, AccessExclusiveLock on pg_statistic's toast table | 
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Steven Winfield | 2019-11-02 22:00:30 | RE: BUG #16059: Tab-completion of filenames in COPY commands removes required quotes | 
| Previous Message | Pavel Stehule | 2019-11-02 20:56:17 | Re: dropdb --force |