On Mon, Jan 15, 2018 at 7:28 AM, Laurenz Albe <laurenz.a...@cybertec.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.1513058...@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. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
quit-exit-rmh-v1.patch
Description: Binary data