|From:||Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>|
|To:||Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>|
|Subject:||Re: BUG #16059: Tab-completion of filenames in COPY commands removes required quotes|
|Views:||Raw Message | Whole Thread | Download mbox | Resend email|
> Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com> writes:
>> I haven't found an explanation in this thread why it does always quote
>> now. That seems a bit unusual. Is there a reason for this? Can we do
>> without it?
> The core problem we're trying to solve is stated in the thread title:
> It'd be possible, perhaps, to distinguish between this case and the
> cases in backslash commands, which are okay with omitted quotes
> (for some filenames). I'm not sure that that would be an improvement
I realized that there *is* a good reason to worry about this. Fairly
recent versions of libedit will try to backslash-escape the output
of psql_completion(), as I described over at . This is absolutely
disastrous if we've emitted a quoted filename: we end up going from,
which of course doesn't work at all (psql thinks \' is in itself a
There isn't much we can do about this in contexts where we must
quote the filename: not doing so produces an equally broken command.
However, this problem does suggest that we shouldn't force quoting
if we don't have to, as that just breaks cases we needn't break.
Hence, the attached revision only forces quoting in a SQL COPY
command, or if the user already typed a quote.
I also added some regression tests (whee!). They pass for me with a
couple different readline and libedit versions, but I have only minimal
hopes for them passing everywhere without further hacking ... the
results of the other thread suggest that pain is to be expected here.
regards, tom lane
|Next Message||Tom Lane||2020-01-06 06:21:35||Re: BUG #16190: The usage of NULL pointer in refint.c|
|Previous Message||Fahar Abbas||2020-01-06 05:49:38||Re: postgresql mac operation issue 10.11|
|Next Message||Arthur Zakirov||2020-01-06 06:20:13||Re: Add pg_file_sync() to adminpack|
|Previous Message||Michael Paquier||2020-01-06 06:01:52||Re: Setting min/max TLS protocol in clientside libpq|