On Friday, January 28, 2022 5:24 AM, Tom Lane <t...@sss.pgh.pa.us> wrote:
> Here's a fleshed-out patch series for this idea.

Thanks for you patch. 
I did some tests on it and here are something cases I feel we need to confirm 
whether they are suitable.

1) postgres=# create table atest(id int, "iD" int, "ID" int);
2) CREATE TABLE
3) postgres=# alter table atest rename i[TAB]
4) id    "iD"
5) postgres=# alter table atest rename I[TAB]
6) id    "iD"

The tab completion for 5) ignored "ID", is that correct?

7) postgres=# create table "aTest"("myCol" int, mycol int);
8) CREATE TABLE
9) postgres=# alter table a[TAB]
10) ALL IN TABLESPACE  atest              "aTest"
11) postgres=# alter table aT[TAB]  -> atest

I think what we are trying to do is to ease the burden of typing double quote 
for user.
But in line 11), the tab completion for "alter table aT[TAB]" is attest,
which makes the tab completion output of "aTest" at 10) no value.
Because if user needs to alter table aTest they still needs to 
type double quote manually.

Another thing is the inconsistency  of the output result.
12) postgres=# alter table atest rename i[TAB]
13) id    "iD"
14) postgres=# alter table atest rename "i[TAB]
15) "id"  "iD"

By applying the new fix, Line 15 added the output of "id".
I think it's good to keep user input '"' and convenient when using tab 
completion.
One the other hand, I'm not so comfortable with the output of "iD" in line 13.
If user doesn't type double quote, why we add double quote to the output?
Could we make the output of 13) like below?
12) postgres=# alter table atest rename i[TAB]
??) id  iD

Regards,
Tang



Reply via email to