Re: proposal: alternative psql commands quit and exit

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: proposal: alternative psql commands quit and exit
Дата
Msg-id CAMsr+YGwxZC+j6nsnjfKDq98rL9YfROL9vOAMkW72+bfJqSWSw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: proposal: alternative psql commands quit and exit  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 12 December 2017 at 13:58, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Craig Ringer <craig@2ndquadrant.com> writes:
> I doubt I've ever written just "exit" or "quit" without indentation. I
> think if it requires them to be a bareword with no indentation, strictly
> ^(exit|quit)\n when isatty, then that's probably a safe and helpful choice.

FWIW, I think that the special behavior (whatever it winds up being
exactly) ought to trigger on an input line matching

        [whitespace]*help[whitespace]*(;[whitespace]*)?

and similarly for exit/quit.  I think that novices might have internalized
enough SQL syntax to think that they need to terminate the command with a
semicolon --- in fact, we regularly see examples in which seasoned users
think they need to terminate backslash commands with a semicolon, so
that's hardly far-fetched.  And we might as well allow as much whitespace
as we can, because nobody but Guido Rossum thinks that having whitespace
be semantically significant is a good idea.


Yeah, I think that's fine - and sensible - if we do what Robert proposed and pass it through to psql's buffer as well as printing some helptext.

It's probably not even that bad if we didn't pass it through, really, as those lines have little good reason to exist on their own, but I'd rather not push our luck.

--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: Using ProcSignal to get memory context stats from a running backend
Следующее
От: Amit Langote
Дата:
Сообщение: Re: Boolean partitions syntax