Re: [HACKERS] Function to move the position of a replication slot - Mailing list pgsql-hackers

From Craig Ringer
Subject Re: [HACKERS] Function to move the position of a replication slot
Date
Msg-id CAMsr+YFYdqpK+m_zXCL4ig5rJE_oTNGsyKMi-so6=a2arpAjkw@mail.gmail.com
Whole thread Raw
In response to [HACKERS] Function to move the position of a replication slot  (Magnus Hagander <magnus@hagander.net>)
Responses Re: [HACKERS] Function to move the position of a replication slot  (Magnus Hagander <magnus@hagander.net>)
List pgsql-hackers
On 4 May 2017 at 20:05, Magnus Hagander <magnus@hagander.net> wrote:
> PFA a patch that adds a new function, pg_move_replication_slot, that makes
> it possible to move the location of a replication slot without actually
> consuming all the WAL on it.

> This can be useful for example to keep replication slots in sync between
> different servers in a replication cluster.

It needs a test to ensure it only operates on physical slots. It
should ERROR on a logical slot, since it has no way of correctly
advancing the catalog_xmin or finding a reasonable restart_lsn  for
logical decoding.

I'm still fine with the name, since I plan to add that capability in
pg11 by running through logical decoding and ReorderBufferSkip()ing
each xact until we reach the target lsn.

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



pgsql-hackers by date:

Previous
From: Neha Sharma
Date:
Subject: Re: [HACKERS] delta relations in AFTER triggers
Next
From: Magnus Hagander
Date:
Subject: Re: [HACKERS] Function to move the position of a replication slot