Re: Feature request: make cluster_name GUC useful for psql prompts

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Jerry Sievers <gsievers19(at)comcast(dot)net>
Cc: Steve Crawford <scrawford(at)pinpointresearch(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Feature request: make cluster_name GUC useful for psql prompts
Date: 2016-05-06 20:03:33
Message-ID: 20160506200333.GA284072@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jerry Sievers wrote:
> Steve Crawford <scrawford(at)pinpointresearch(dot)com> writes:
>
> > That is almost identical to the solution I suggested a week or two ago to someone tackling the issue and the hack works on initial connection.
> >
> > Connect to a different cluster with "\c", however, and it will leave the prompt showing you connected to the original database which is not good.
>
> True and I've always thought of it as a possible misfeature of psql that
> it scans .psqlrc only once.

Interesting point. I think what you're saying boils down to there being
two init files, one that is read once at program start (sets up the
general environment) and another one that's executed each time a
connection is established.

I wonder where does this leave Greg Stark's concurrent psql sessions
feature.

Now, for the current case I think we should definitely have a specifier
for the prompt.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-05-06 20:07:35 Re: Initial release notes created for 9.6
Previous Message Tom Lane 2016-05-06 19:59:33 Re: Initial release notes created for 9.6