Robert Haas <robertmhaas@gmail.com> writes:
> On Fri, Dec 8, 2017 at 8:57 AM, Daniel Vérité" <daniel@manitou-mail.org> wrote:
>> When looking at the most popular postgres questions on stackoverflow:
>> https://stackoverflow.com/questions/tagged/postgresql?sort=votes
>> the first one (most up-voted) happens to be:
>> "How to exit from PostgreSQL command line utility: psql"
>> now at 430k views and 1368 upvotes.
> Wow, that's pretty crazy. I was going to vote against this proposal,
> but I think I might change my mind. How can we say that this isn't a
> problem for users given that data? It's evidently not only *a*
> problem, but arguably the biggest one.
I actually agree that there's a problem there. What I find pretty dubious
is the claim that this patch will fix it.
If we could see our way to recognizing help/quit/exit on a line by
themselves even when there's data in the query buffer, the argument
that we've improved matters for novices would be *far* stronger.
However, given that this is legal, fully-spec-compliant SQL:
select a, b
exit
from mytable;
I'm not sure how we could get away with that. Would it pass muster to do
that only when isatty(stdin)? Other ideas?
regards, tom lane