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

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, steven(dot)winfield(at)cantabcapital(dot)com
Subject: Re: BUG #16059: Tab-completion of filenames in COPY commands removes required quotes
Date: 2020-01-13 16:34:37
Message-ID: 1ed54e8f-d84e-bfbe-ffad-890015e12735@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs 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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Adam Scott 2020-01-13 18:56:32 Re: BUG #16122: segfault pg_detoast_datum (datum=0x0) at fmgr.c:1833 numrange query
Previous Message Pavel Stehule 2020-01-13 16:26:41 Re: Cannot create index on Jsonb timestamp field

Browse pgsql-hackers by date

  From Date Subject
Next Message Mahendra Singh Thalor 2020-01-13 18:20:41 Re: [HACKERS] Block level parallel vacuum
Previous Message Tomas Vondra 2020-01-13 16:32:53 Re: [Proposal] Global temporary tables