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

From: "tanghy(dot)fnst(at)fujitsu(dot)com" <tanghy(dot)fnst(at)fujitsu(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: [PATCH] support tab-completion for single quote input with equal sign
Date: 2021-07-22 04:04:46
Message-ID: OS0PR01MB6113F66C90164C3DAA025955FBE49@OS0PR01MB6113.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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 WORD_BREAKS.
Which causes words count is not correct for a input command string.

Fix the problem in the attached patch. By fix this, "\t\n(at)$><=;|&{() " will not be taken as WORD_BREAKS in single quoted input string.
Please be kindly to take a look at the fix and kindly to tell me if you find any scenario affected by the fix.

Regards,
Tang

Attachment Content-Type Size
0001-support-tab-completion-for-single-quote-input-with-e.patch application/octet-stream 1.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2021-07-22 04:06:21 window build doesn't apply PG_CPPFLAGS correctly
Previous Message Amit Kapila 2021-07-22 03:55:47 Re: [bug?] Missed parallel safety checks, and wrong parallel safety