Re: proposal: alternative psql commands quit and exit

Поиск
Список
Период
Сортировка
От Everaldo Canuto
Тема Re: proposal: alternative psql commands quit and exit
Дата
Msg-id CACYgWU=KorigPcWdMQrQrcRdLRSap-EehNd5S-nEzvG1dQtsRw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: proposal: alternative psql commands quit and exit  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers


On Fri, Dec 8, 2017 at 8:10 AM, Michael Paquier <michael.paquier@gmail.com> wrote:
I think that you are going to need better reasons than just being more
friendly with other database clients by breaking a rule which is
around for 20 years.

Well, that reason was enough for other sql clients to implement "\q" and "\quit" even if they don't use "\" commands.
Note that we are not breaking a rule, we already have "help" without slash and as I said, "slash way" still supported and still oficial way to exit.
 
For one, it seems to me that your patch is
breaking multi-line SQL support with psql, as "quit" or "exit" are
legit SQL object names.

No, it is not breaking. Did you test it? My patch takes care of multi-line commands. Look at second line of patch:

    pset.cur_cmd_interactive && query_buf->len == 0

Line 4 also take care about other possible problems:

    (line[4] == '\0' || line[4] == ';' || isspace((unsigned char) line[4])))


I know that this "feature" don't make any difference for most of you guys but also it will not hurt anyone and will help a little for newcomers and people that uses different sql clients. To be honest. I could understand that is not a good idea to accept patches like this if it is too big since it could make things hard to maintainers but honestly, this patch is very small and trivial.


Regards.

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

Предыдущее
От: Amit Langote
Дата:
Сообщение: no partition pruning when partitioning using array type
Следующее
От: Alexander Korotkov
Дата:
Сообщение: Re: [HACKERS] Proposal for CSN based snapshots