Waiting for PostgreSQL 13 – Add %x to default PROMPT1 and PROMPT2 in psql

On 12nd of February 2020, Michael Paquier committed patch:

Add %x to default PROMPT1 and PROMPT2 in psql
 
%d can be used to track if the current connection is in a transaction
block or not, and adding it by default to the prompt has the advantage
to not need a modification of .psqlrc, something not possible depending
on the environment.
 
This discussion has happened across various sources, and there was a
strong consensus in favor of this change.
 
Author: Vik Fearing
Reviewed-by: Fabien Coelho
Discussion: https://postgr.es/m/09502c40-cfe1-bb29-10f9-4b3fa7b2bbb2@2ndquadrant.com

Continue reading Waiting for PostgreSQL 13 – Add %x to default PROMPT1 and PROMPT2 in psql

Waiting for PostgreSQL 13 – Allow invisible PROMPT2 in psql.

On 19th of November 2019, Thomas Munro committed patch:

Allow invisible PROMPT2 in psql. 
 
Keep track of the visible width of PROMPT1, and provide %w as a way
for PROMPT2 to generate the same number of spaces.
 
Author: Thomas Munro, with ideas from others
 
Discussion: https://postgr.es/m/CA%2BhUKG%2BzGd7RigjWbxwhzGW59gUpf76ydQECeGdEdodH6nd__A%40mail.gmail.com

Continue reading Waiting for PostgreSQL 13 – Allow invisible PROMPT2 in psql.

Waiting for 9.6 – Add psql PROMPT variable showing the pid of the connected to backend.

On 7th of July, Andres Freund committed patch:

Add psql PROMPT variable showing the pid of the connected to backend.
 
The substitution for the pid is %p.
 
Author: Julien Rouhaud
Discussion: <a href="http://git.postgresql.org/gitweb/?p=postgresql.git;a=object;h=116262CF971C844FB6E793F8809B51C6E99D48">116262CF971C844FB6E793F8809B51C6E99D48</a>@BPXM02GP.gisp.nec.co.jp

Continue reading Waiting for 9.6 – Add psql PROMPT variable showing the pid of the connected to backend.

Waiting for 9.5 – Add psql PROMPT variable showing which line of a statement is being edited.

On 2nd of September, Andres Freund committed patch:

Add psql PROMPT variable showing which line of a statement is being edited.
 
The new %l substitution shows the line number inside a (potentially
multi-line) statement starting from one.
 
Author: Sawada Masahiko, heavily editorialized by me.
Reviewed-By: Jeevan Chalke, Alvaro Herrera

Continue reading Waiting for 9.5 – Add psql PROMPT variable showing which line of a statement is being edited.