Re: [PATCH] support tab-completion for single quote input with equal sign

2023-01-11 Thread torikoshia
On 2023-01-11 11:28, Tom Lane wrote: I wrote: I've spent some effort previously on getting tab-completion to deal sanely with single-quoted strings, but everything I've tried has crashed and burned :-(, mainly because it's not clear when to take the whole literal as one "word" and when not.

Re: [PATCH] support tab-completion for single quote input with equal sign

2023-01-10 Thread Tom Lane
I wrote: > I've spent some effort previously on getting tab-completion to deal > sanely with single-quoted strings, but everything I've tried has > crashed and burned :-(, mainly because it's not clear when to take > the whole literal as one "word" and when not. After a little further thought, a

Re: [PATCH] support tab-completion for single quote input with equal sign

2023-01-10 Thread Tom Lane
torikoshia writes: > I updated the patch going along with the v3 direction. I think this adds about as many failure modes as it removes, if not more. * The connection string doesn't necessarily end with "'"; it could be a dollar-quoted string. * If it is a dollar-quoted string, there could be

Re: [PATCH] support tab-completion for single quote input with equal sign

2023-01-10 Thread torikoshia
On Thursday, July 22, 2021 1:05 PM, tanghy(dot)fnst(at)fujitsu(dot)com wrote I found a problem when using tab-completion as follows: CREATE SUBSCRIPTION my_subscription CONNECTION 'host=localhost port=5432 dbname=postgres' [TAB] The word 'PUBLICATION' couldn't be auto completed as expected.

Re: [PATCH] support tab-completion for single quote input with equal sign

2021-12-05 Thread Kyotaro Horiguchi
At Fri, 3 Dec 2021 15:16:55 +0900, Michael Paquier wrote in > On Fri, Sep 17, 2021 at 02:45:57AM +0900, Kyotaro Horiguchi wrote: > > This test fails for the same reason, but after fixing it the result > > contains \a (BEL) in the output on my CentOS8. I'm not sure what is > > happening here.. >

Re: [PATCH] support tab-completion for single quote input with equal sign

2021-12-02 Thread Michael Paquier
On Fri, Sep 17, 2021 at 02:45:57AM +0900, Kyotaro Horiguchi wrote: > This test fails for the same reason, but after fixing it the result > contains \a (BEL) in the output on my CentOS8. I'm not sure what is > happening here.. The patch is still failing under the CF bot, and this last update was

Re: [PATCH] support tab-completion for single quote input with equal sign

2021-09-16 Thread Kyotaro Horiguchi
At Sat, 04 Sep 2021 10:18:24 -0400, Tom Lane wrote in > I kind of wonder if it isn't time to enlist the help of psqlscan.l > instead of doubling down on the idea that tab-complete.c should have > its own half-baked SQL lexer. So, I played with this idea and came up with the attached WIP. The

RE: [PATCH] support tab-completion for single quote input with equal sign

2021-09-15 Thread tanghy.f...@fujitsu.com
On Saturday, September 4, 2021 11:58 PM, Tom Lane wrote: >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

Re: [PATCH] support tab-completion for single quote input with equal sign

2021-09-08 Thread Jacob Champion
On Wed, 2021-09-08 at 17:08 -0400, Tom Lane wrote: > Jacob Champion writes: > > On Sat, 2021-09-04 at 11:32 -0400, Tom Lane wrote: > > > Independently of the concerns I raised, I'm wondering how come you > > > are getting different results. Which readline or libedit version > > > are you using,

Re: [PATCH] support tab-completion for single quote input with equal sign

2021-09-08 Thread Tom Lane
Jacob Champion writes: > On Sat, 2021-09-04 at 11:32 -0400, Tom Lane wrote: >> Independently of the concerns I raised, I'm wondering how come you >> are getting different results. Which readline or libedit version >> are you using, on what platform? > Now you have me worried... > - Ubuntu 20.04

Re: [PATCH] support tab-completion for single quote input with equal sign

2021-09-08 Thread Jacob Champion
On Sat, 2021-09-04 at 11:32 -0400, Tom Lane wrote: > Jacob Champion writes: > > t/010_tab_completion.pl .. 17/? > > # Failed test 'tab-completion after single quoted text input with > > equal sign' > > # at t/010_tab_completion.pl line 198. > > # Actual output was "CREATE

Re: [PATCH] support tab-completion for single quote input with equal sign

2021-09-04 Thread Tom Lane
Jacob Champion writes: > t/010_tab_completion.pl .. 17/? > # Failed test 'tab-completion after single quoted text input with equal > sign' > # at t/010_tab_completion.pl line 198. > # Actual output was "CREATE SUBSCRIPTION my_sub CONNECTION > 'host=localhost port=5432

Re: [PATCH] support tab-completion for single quote input with equal sign

2021-09-04 Thread Tom Lane
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 >

Re: [PATCH] support tab-completion for single quote input with equal sign

2021-09-04 Thread Tom Lane
"tanghy.f...@fujitsu.com" writes: > [ v2-0001-support-tab-completion-for-single-quote-input-wit.patch ] 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

Re: [PATCH] support tab-completion for single quote input with equal sign

2021-09-03 Thread Jacob Champion
Hi Tang, On Fri, 2021-09-03 at 04:32 +, tanghy.f...@fujitsu.com wrote: > I'd appreciate it if you can share your test results with me. Sure! Here's my output (after a `make clean && make`): cd . && TESTDIR='/home/pchampion/workspace/postgres/src/bin/psql'

RE: [PATCH] support tab-completion for single quote input with equal sign

2021-09-02 Thread tanghy.f...@fujitsu.com
On Friday, September 3, 2021 2:14 AM, Jacob Champion wrote >I applied your patch against HEAD (and did a clean build for good >measure) but couldn't get the tab-completion you described -- on my >machine, `PUBLICATION` still fails to complete. Tab completion is >working in general, for example

Re: [PATCH] support tab-completion for single quote input with equal sign

2021-09-02 Thread Jacob Champion
On Fri, 2021-07-23 at 05:34 +, tanghy.f...@fujitsu.com wrote: > On Thursday, July 22, 2021 1:05 PM, tanghy.f...@fujitsu.com > wrote > > I found a problem when using tab-completion as follows: > > > > CREATE SUBSCRIPTION my_subscription > > CONNECTION 'host=localhost port=5432

RE: [PATCH] support tab-completion for single quote input with equal sign

2021-07-22 Thread tanghy.f...@fujitsu.com
On Thursday, July 22, 2021 1:05 PM, tanghy.f...@fujitsu.com wrote >I found a problem when using tab-completion as follows: > >CREATE SUBSCRIPTION my_subscription >CONNECTION 'host=localhost port=5432 dbname=postgres' [TAB] > >The word 'PUBLICATION' couldn't be auto completed as expected. Added

[PATCH] support tab-completion for single quote input with equal sign

2021-07-21 Thread tanghy.f...@fujitsu.com
Hi I found a problem when using tab-completion as follows: CREATE SUBSCRIPTION my_subscription CONNECTION 'host=localhost port=5432 dbname=postgres' [TAB] The word 'PUBLICATION' couldn't be auto completed as expected. The reason is that the equal sign in a single quote is taken as