Re: Specifying both recovery_target_xid and recovery_target_time

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Specifying both recovery_target_xid and recovery_target_time
Date: 2014-01-08 17:36:22
Message-ID: CA+U5nMLX2h_5xnvSAenjZ6DB7cyY+PRy7NnDXqF--428j3CPJg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 8 January 2014 15:38, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com> wrote:
> The docs say:
>
>> At most one of recovery_target_time, recovery_target_name or
>> recovery_target_xid can be specified
>
>
> However, the code actually allows them all to be specified at the same time:
>
>> else if (strcmp(item->name, "recovery_target_name") == 0)
>> {
>> /*
>> * if recovery_target_xid specified, then this
>> overrides
>> * recovery_target_name
>> */
>> if (recoveryTarget == RECOVERY_TARGET_XID)
>> continue;
>> recoveryTarget = RECOVERY_TARGET_NAME;
>
>
> The precedence is XID, time, name.
>
> I think the documented behavior would make more sense, ie. throw an error if
> you try to specify multiple targets. Anyone remember if that was
> intentional? Any objections to change the code to match the docs, in master?

It seems like I was grasping at some meaning but didn't quite achieve it.

Changing it to mean OR would make sense, but that would be more work.

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2014-01-08 17:39:23 Re: Standalone synchronous master
Previous Message Tom Lane 2014-01-08 16:13:20 Re: Simple improvements to freespace allocation