Re: proposal: alternative psql commands quit and exit - Mailing list pgsql-hackers

From Tom Lane
Subject Re: proposal: alternative psql commands quit and exit
Date
Msg-id 20860.1516035332@sss.pgh.pa.us
Whole thread Raw
In response to Re: proposal: alternative psql commands quit and exit  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: proposal: alternative psql commands quit and exit
List 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 by date:

Previous
From: Geoff Winkless
Date:
Subject: Re: proposal: alternative psql commands quit and exit
Next
From: David Fetter
Date:
Subject: Re: proposal: alternative psql commands quit and exit