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: Daniel Vérité <daniel(at)manitou-mail(dot)org>, Everaldo Canuto <everaldo(dot)canuto(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: proposal: alternative psql commands quit and exit
Date: 2017-12-08 19:07:05
Message-ID: 31478.1512760025@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 Fri, Dec 8, 2017 at 8:57 AM, Daniel Vérité" <daniel(at)manitou-mail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message hvjunk 2017-12-08 19:08:14 Re: proposal: alternative psql commands quit and exit
Previous Message Robert Haas 2017-12-08 18:56:23 Re: proposal: alternative psql commands quit and exit