pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@lists.postgresql.org
Cc: steven.winfield@cantabcapital.com
Subject: Re: BUG #16059: Tab-completion of filenames in COPY commands removes required quotes
Date: Mon, 13 Jan 2020 17:34:37 +0100
Message-ID: <1ed54e8f-d84e-bfbe-ffad-890015e12735@2ndquadrant.com> (raw)
In-Reply-To: <32307.1578290788@sss.pgh.pa.us>
References: <16059-8836946734c02b84@postgresql.org>
	<30313.1572729260@sss.pgh.pa.us>
	<1628.1572820800@sss.pgh.pa.us>
	<6ccd23e4-ce58-c2b5-39a1-801a9937ae86@2ndquadrant.com>
	<12699.1578058657@sss.pgh.pa.us>
	<32307.1578290788@sss.pgh.pa.us>

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





view thread (31+ messages)  latest in thread

Message-ID: <1ed54e8f-d84e-bfbe-ffad-890015e12735@2ndquadrant.com>
Permalink:  ../1ed54e8f-d84e-bfbe-ffad-890015e12735@2ndquadrant.com/
Also on:    postgresql.org/message-id/1ed54e8f-d84e-bfbe-ffad-890015e12735@2ndquadrant.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: peter.eisentraut@2ndquadrant.com, tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org, steven.winfield@cantabcapital.com
  Subject: Re: BUG #16059: Tab-completion of filenames in COPY commands removes required quotes
  In-Reply-To: <1ed54e8f-d84e-bfbe-ffad-890015e12735@2ndquadrant.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox