Re: proposal: alternative psql commands quit and exit

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: proposal: alternative psql commands quit and exit
Дата
Msg-id 20860.1516035332@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: proposal: alternative psql commands quit and exit  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: proposal: alternative psql commands quit and exit  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Mon, Jan 15, 2018 at 10:57 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I was kind of imagining that we could make the hint text vary depending
>> on the parsing state.  Maybe that's too hard to get to --- but if the
>> prompt-creating code knows what it is, perhaps this can too.

> More broadly, I think what is needed here is less C-fu than
> English-fu.  If we come up with something good, we can make it print
> that thing.

Right, but if we're willing to look at the parse state, we don't need
to cram all possible knowledge into one 80-character string.  I'm
thinking about just responding to the current situation, say

You have begun a quoted string.  To end it, type '

(or ", or $foo$ as appropriate).  I'm inclined to violate our usual
message style guidelines here by not putting any quotes or punctuation
around the ending quote ... more likely to confuse than help.

Or, if you're not in a string but there's text in the buffer,

You have entered an incomplete SQL command.
Type ; to send it or \r to discard it.

Or, if there's no text in the buffer, we print the existing help
message for "help", or just exit for quit/exit.

            regards, tom lane


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

Предыдущее
От: Geoff Winkless
Дата:
Сообщение: Re: proposal: alternative psql commands quit and exit
Следующее
От: David Fetter
Дата:
Сообщение: Re: proposal: alternative psql commands quit and exit