Re: [Patch] New psql prompt substitution %r (m = master, r = replica) - Mailing list pgsql-hackers

From Jim Nasby
Subject Re: [Patch] New psql prompt substitution %r (m = master, r = replica)
Date
Msg-id d76d2619-6fc1-3f06-b945-fc053fdf2012@BlueTreble.com
Whole thread Raw
In response to Re: [Patch] New psql prompt substitution %r (m = master, r = replica)  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
On 8/18/16 10:05 AM, Alvaro Herrera wrote:
> Bash has PROMPT_COMMAND, which is executed prior to issuing each prompt.
> What about introducing such a feature into psql?  Then the \gset command
> you had in your first post could be used to set the variable correctly
> just before each prompt.

As someone that has the backend PID in his prompt... +1. Or 
alternatively, a command that is just run when the connection changes 
instead of every command...
-- 
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532)   mobile: 512-569-9461



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Bug in to_timestamp().
Next
From: Stefan Kaltenbrunner
Date:
Subject: Re: WIP: About CMake v2