Re: Add %r substitution for psql prompts to show recovery status

From: Ian Barwick <ian(dot)barwick(at)2ndquadrant(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>, robertmhaas(at)gmail(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Add %r substitution for psql prompts to show recovery status
Date: 2018-01-23 00:28:45
Message-ID: a8756d84-01bd-71a1-7a1c-25aac3a1384d@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 01/23/2018 03:19 AM, Peter Eisentraut wrote:
> On 1/9/18 15:36, Peter Eisentraut wrote:
>> On 12/7/17 19:54, Tatsuo Ishii wrote:
>>>> On Wed, Dec 6, 2017 at 9:19 PM, Ian Barwick <ian(dot)barwick(at)2ndquadrant(dot)com> wrote:
>>>>> Note this substitution sends a "pg_is_in_recovery()" query to the server
>>>>> each time it's encountered; unless there's something I'm overlooking I
>>>>> think that's the only reliable way to determine current recovery status.
>>>>
>>>> That seems kinda painful.
>>>>
>>>> And what happens in an aborted transaction?
>>>
>>> Yeah. I think we need some from help backend for this. For example, a
>>> parameter status message can be used here. If PostgreSQL moves to the
>>> recovery state or vice versa, PostgreSQL sends the parameter status
>>> message to frontend.
>>
>> I agree a backend status message is the right way to do this.
>>
>> We could perhaps report transaction_read_only, if we don't want to add a
>> new one.
>
> I'm setting this CF item to returned with feedback, since it would
> apparently be a much bigger change than then initial patch.

Yup, agree :)

Thanks for the feedback!

Regards

Ian Barwick

--
Ian Barwick http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2018-01-23 01:22:50 Re: [HACKERS] Parallel tuplesort (for parallel B-Tree index creation)
Previous Message Thomas Munro 2018-01-22 23:57:49 Re: [HACKERS] Adding column_constraint description in ALTER TABLE synopsis