From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | "tanghy(dot)fnst(at)fujitsu(dot)com" <tanghy(dot)fnst(at)fujitsu(dot)com> |
Cc: | Jacob Champion <pchampion(at)vmware(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: [PATCH] support tab-completion for single quote input with equal sign |
Date: | 2021-09-04 14:57:57 |
Message-ID: | 2698203.1630767477@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
I wrote:
> Surely this patch is completely wrong? It needs more thought about
> the interaction with the existing logic for double quotes, ie single
> quote inside double quotes is not special, nor the reverse; nor should
> parentheses inside quotes be counted. It also needs to be aware of
> backslashes in escape-style strings.
Actually ... those are just implementation details, and now that
I've thought about it a little more, I question the entire concept
of making single-quoted strings be single words in tab-complete's
view. I think it's quite intentional that we don't do that;
if we did, it'd forever foreclose the possibility of tab-completing
*within* strings. You don't have to look any further than CREATE
SUBSCRIPTION itself to see possible applications of that: someone
could wish that
CREATE SUBSCRIPTION my_sub CONNECTION 'db<TAB>
would complete with "name=", or that <TAB> right after the quote
would offer a list of connection keywords.
(More generally, I'm afraid that people are already relying on this
behavior in other contexts, and thus that the proposed patch could
break more use-cases than it fixes.)
So now I think that this approach should be rejected, and that the
right thing is to fix the CREATE SUBSCRIPTION completion rules
to allow more than one "word" between CONNECTION and PUBLICATION.
Another idea that might be useful is to treat the opening and
closing quotes themselves as separate "words", which'd give
the CREATE SUBSCRIPTION rules a bit more to go on about when to
offer PUBLICATION.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2021-09-04 15:32:26 | Re: [PATCH] support tab-completion for single quote input with equal sign |
Previous Message | Alvaro Herrera | 2021-09-04 14:41:04 | Re: Column Filtering in Logical Replication |