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

From Daniel Vérité
Subject Re: proposal: alternative psql commands quit and exit
Date
Msg-id ad75eab6-71ea-4e1f-8aa5-68876ff50651@manitou-mail.org
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  (Everaldo Canuto <everaldo.canuto@gmail.com>)
List 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


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: pgsql: Prohibit identity columns on typed tables and partitions
Next
From: Stephen Frost
Date:
Subject: Re: Speeding up pg_upgrade