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

From Chapman Flack
Subject Re: proposal: alternative psql commands quit and exit
Date
Msg-id d43d2924-6db1-55cd-c189-081a1cbaaeb4@anastigmatix.net
Whole thread Raw
In response to Re: proposal: alternative psql commands quit and exit  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: proposal: alternative psql commands quit and exit  (Craig Ringer <craig@2ndquadrant.com>)
List pgsql-hackers
On 12/11/2017 04:16 PM, Tom Lane wrote:
> Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
>> No opinion on that, but if the problem is that people don't know how to
>> quit psql, then we should just put that information back into the
>> welcome message and be done with it.
> 
> I don't think people read the welcome message, or at least they
> immediately forget it.

I'm still a wholehearted supporter of Robert's idea in

https://www.postgresql.org/message-id/CA%2BTgmoZswp00PtcgPfQ9zbbh7HUTgsLLJ9Z1x9E2s8Y7ep048g%40mail.gmail.com

to simply produce helpful messages to stderr when isatty(stdin) and
'exit' or 'quit' arrives on a line by itself. Simple, clear, you end
up learning how psql works, and getting help doing it, at the moment
you want it. No change to semantics. Brilliant.

I'm not just saying that because its exactly the suggestion I was
preparing to compose when I scrolled to Robert's message and saw
I'd been scooped. (Or maybe I am.)

I don't even think it's necessarily worthwhile to treat them any
differently when *not* on a continuation line. Why not just always
have a bare 'exit' or 'quit', when isatty(stdin), give you a little
reminder about \?, \q, ^C/\r and leave the next step up to you?

Maybe the part of the reminder about ^C / \r to clear the input
buffer could be reserved for when the buffer isn't empty. On second
thought, no, it will be appropriate every time, because now the buffer
has at least your exit or quit in it.

-Chap


pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [HACKERS] Moving relation extension locks out of heavyweightlock manager
Next
From: Tom Lane
Date:
Subject: Re: Jsonb transform for pl/python