Re: pg_control_recovery() return value when not in recovery

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Joe Conway <mail(at)joeconway(dot)com>
Subject: Re: pg_control_recovery() return value when not in recovery
Date: 2017-09-18 06:33:39
Message-ID: CAB7nPqS57EG72dxVZuoHz09Hdk+a6EZXmfXmzmG0p2YpO1oKWA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Sep 18, 2017 at 3:29 PM, Andres Freund <andres(at)anarazel(dot)de> wrote:
> On 2017-09-18 07:24:43 +0100, Simon Riggs wrote:
>> On 18 September 2017 at 05:50, Andres Freund <andres(at)anarazel(dot)de> wrote:
>> > Hi,
>> >
>> > Just noticed that we're returning the underlying values for
>> > pg_control_recovery() without any checks:
>> > postgres[14388][1]=# SELECT * FROM pg_control_recovery();
>> > ┌──────────────────────┬───────────────────────────┬──────────────────┬────────────────┬───────────────────────────────┐
>> > │ min_recovery_end_lsn │ min_recovery_end_timeline │ backup_start_lsn │ backup_end_lsn │ end_of_backup_record_required │
>> > ├──────────────────────┼───────────────────────────┼──────────────────┼────────────────┼───────────────────────────────┤
>> > │ 0/0 │ 0 │ 0/0 │ 0/0 │ f │
>> > └──────────────────────┴───────────────────────────┴──────────────────┴────────────────┴───────────────────────────────┘
>> > (1 row)
>>
>> Yes, that would have made sense for these to be NULL
>
> Yea, that's what I think was well. Joe, IIRC that's your code, do you
> agree as well?

+1 for NULLness here. That was a point not covered during the review
of the feature.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeevan Chalke 2017-09-18 07:07:46 Re: Partition-wise aggregation/grouping
Previous Message Andres Freund 2017-09-18 06:29:32 Re: pg_control_recovery() return value when not in recovery