Re: [PATCH] psql: Add tab-complete for optional view parameters

Поиск
Список
Период
Сортировка
От Dean Rasheed
Тема Re: [PATCH] psql: Add tab-complete for optional view parameters
Дата
Msg-id CAEZATCWOrEdpJ_e7L6+JPQDpMaJ2VFHm9M7wc6i94uFow7rEJQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATCH] psql: Add tab-complete for optional view parameters  (David Zhang <david.zhang@highgo.ca>)
Ответы Re: [PATCH] psql: Add tab-complete for optional view parameters  (Shubham Khanna <khannashubham1197@gmail.com>)
Список pgsql-hackers
On Mon, 14 Aug 2023 at 18:34, David Zhang <david.zhang@highgo.ca> wrote:
>
> it would be great to switch the order of the 3rd and the 4th line to make a
> better match for "CREATE" and "CREATE OR REPLACE" .
>

I took a look at this, and I think it's probably neater to keep the
"AS SELECT" completion for CREATE [OR REPLACE] VIEW xxx WITH (*)
separate from the already existing support for "AS SELECT" without
WITH.

A couple of other points:

1. It looks slightly neater, and works better, to complete one word at
a time -- e.g., "WITH" then "(", instead of "WITH (", since the latter
doesn't work if the user has already typed "WITH".

2. It should also complete with "=" after the option, where appropriate.

3. CREATE VIEW should offer "local" and "cascaded" after
"check_option" (though there's no point in doing likewise for the
boolean options, since they default to true, if present, and false
otherwise).

Attached is an updated patch, incorporating those comments.

Barring any further comments, I think this is ready for commit.

Regards,
Dean

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alexander Lakhin
Дата:
Сообщение: Re: Random pg_upgrade test failure on drongo
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: WaitEventSet resource leakage