Re: pg_control_recovery() return value when not in recovery

From: Joe Conway <mail(at)joeconway(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>,Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_control_recovery() return value when not in recovery
Date: 2017-09-18 12:53:57
Message-ID: DCAC507C-F760-4732-89EA-1DACECE3E015@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Sorry for the top post. Sounds reasonable to me. Cannot look closely until Tuesday or so.

Joe

On September 17, 2017 11:29:32 PM PDT, 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?
>
>
>> > postgres[14388][1]=# SELECT pg_is_in_recovery();
>> > ┌───────────────────┐
>> > │ pg_is_in_recovery │
>> > ├───────────────────┤
>> > │ f │
>> > └───────────────────┘
>> > (1 row)
>>
>> But not this, since it is a boolean and the answer is known.
>
>Oh, that was just for reference, to show that the cluster isn't in
>recovery...
>
>
>- Andres

--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nikita Glukhov 2017-09-18 13:02:54 Re: SQL/JSON in PostgreSQL
Previous Message Gaddam Sai Ram 2017-09-18 12:40:30 Re: Error: dsa_area could not attach to a segment that has been freed