Re: proposal: alternative psql commands quit and exit

From: "Daniel Vérité" <daniel(at)manitou-mail(dot)org>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>,"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-09 13:36:43
Message-ID: ad75eab6-71ea-4e1f-8aa5-68876ff50651@manitou-mail.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:

> The typical interaction I'd foresee is more like
>
> postgres=> select 2+2 (user forgets semicolon)
> postgres-> help
> postgres-> quit
> postgres-> exit

A part of this is due to the default PROMPT2 being too similar to PROMPT1.
The significance of '=' turning to '-' is easily lost on newbies.

By comparison, the mysql client seems a bit more intuitive
for this, with this presentation:

mysql> select 2+2
-> help
-> quit
-> exit
The "mysql" part is replaced by spaces on secondary prompts, so
visually it's more obvious that it's a different state.
The space-padding is necessary to keep the user input left-aligned.

Maybe PROMPT2 could be improved in that direction in psql.
For instance, I wonder if it'd be doable to have PROMPT2 with the line
number and proper alignment, so the above session could end up displayed
like this:

postgres=> select 2+2
2-> help
3-> quit
4-> exit

That way, the more lines are typed, the more it becomes obvious that
you're in a multi-line statement. Plus numbering lines might
be useful in general, anyway.

Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2017-12-09 13:45:14 Re: Speeding up pg_upgrade
Previous Message Magnus Hagander 2017-12-09 10:47:25 Re: pgsql: Prohibit identity columns on typed tables and partitions