Re: proposal: alternative psql commands quit and exit

From: Stephen Frost <sfrost(at)snowman(dot)net>
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>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Vik Fearing <vik(dot)fearing(at)2ndquadrant(dot)com>, 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 15:48:55
Message-ID: 20180115154855.GM2416@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert,

* Robert Haas (robertmhaas(at)gmail(dot)com) wrote:
> On Mon, Jan 15, 2018 at 7:28 AM, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at> wrote:
> > Everaldo Canuto wrote:
> >> Also I don't see a consensus on this thread and I don't understand how decisions are taken.
> >
> > It's just difficult to find consensus with many people.
> >
> > There were several valid concerns with this, the most striking (to me)
> > was Tome's concern that there are perfectly valid multi-line SQL statements
> > where a line could start with "exit" or "quit".
> >
> > Robert Haas had an idea how to provide useful hints without breaking anything,
> > but it seemed a little complicated.
>
> It's not really that complicated. Here's a patch. This follows what
> Tom suggested in http://postgr.es/m/30157.1513058300@sss.pgh.pa.us and
> what I suggested in
> https://www.postgresql.org/message-id/CA%2BTgmoZswp00PtcgPfQ9zbbh7HUTgsLLJ9Z1x9E2s8Y7ep048g%40mail.gmail.com
>
> I've discovered one thing about this design that is not so good, which
> is that if you open a single, double, or dollar quote, then the
> instructions that are provided under that design do not work:
>
> rhaas=# select $$
> rhaas$# quit
> Use \q to quit or press control-C to clear the input buffer.
> rhaas$# \q
> rhaas$# well this sucks
> rhaas$#

> Obviously this leaves something to be desired, but I think it's
> probably just a matter of rephrasing the hint somehow. I didn't have
> a good idea off-hand though, so here's the patch as I have it.

Well, control-C would still work in that case, so I'm not sure that it's
so bad. It's certainly better than what we have now. I would have
thought to include a hint to use \? for help too but it might make the
hint too long. How about putting control-C first, like this?:

Press control-C to abort a command, \q to quit, or \? for help

Thanks!

Stephen

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-01-15 15:57:08 Re: proposal: alternative psql commands quit and exit
Previous Message Robert Haas 2018-01-15 15:36:21 Re: Rangejoin rebased