Re: BUG #16059: Tab-completion of filenames in COPY commands removesrequired quotes - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: BUG #16059: Tab-completion of filenames in COPY commands removesrequired quotes
Date
Msg-id 1ed54e8f-d84e-bfbe-ffad-890015e12735@2ndquadrant.com
Whole thread Raw
In response to Re: BUG #16059: Tab-completion of filenames in COPY commands removes required quotes  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #16059: Tab-completion of filenames in COPY commands removes required quotes
List pgsql-hackers
On 2020-01-06 07:06, Tom Lane wrote:
> Hence, the attached revision only forces quoting in a SQL COPY
> command, or if the user already typed a quote.

Yes, that seems better.  Users tend to not like if tab completion messes 
with what they have already typed unless strictly necessary.

The file name completion portion of this patch seems to work quite well now.

I have found a weird behavior with identifier quoting, which is not the 
subject of this patch, but it appears to be affected by it.

The good thing is that the new code will behave sensibly with

select * from "pg_cl<TAB>

which the old code didn't offer anything on.

The problem is that if you have

create table "test""1" (a int);

then the new code responds to

select * from "te<TAB>

by making that

select * from "te"

whereas the old code curiously handled that perfectly.

Neither the old nor the new code will produce anything from

select * from te<TAB>

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: [Proposal] Global temporary tables
Next
From: Mahendra Singh Thalor
Date:
Subject: Re: [HACKERS] Block level parallel vacuum