Re: proposal: alternative psql commands quit and exit

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Everaldo Canuto <everaldo(dot)canuto(at)gmail(dot)com>, Chapman Flack <chap(at)anastigmatix(dot)net>, Vik Fearing <vik(dot)fearing(at)2ndquadrant(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: alternative psql commands quit and exit
Date: 2018-01-15 16:55:32
Message-ID: 20860.1516035332@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Mon, Jan 15, 2018 at 10:57 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2018-01-15 16:56:23 Re: proposal: alternative psql commands quit and exit
Previous Message Geoff Winkless 2018-01-15 16:53:27 Re: proposal: alternative psql commands quit and exit