[PATCH] Allow to specify restart_lsn inpg_create_physical_replication_slot() - Mailing list pgsql-hackers

From Vyacheslav Makarov
Subject [PATCH] Allow to specify restart_lsn inpg_create_physical_replication_slot()
Date
Msg-id a7388f45d8744b17ec8b05beb20d84ea@postgrespro.ru
Whole thread Raw
Responses Re: [PATCH] Allow to specify restart_lsn inpg_create_physical_replication_slot()  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
Hello, hackers.

I would like to propose a patch, which allows passing one extra 
parameter to pg_create_physical_replication_slot() — restart_lsn. It 
could be very helpful if we already have some backup with STOP_LSN from 
a couple of hours in the past and we want to quickly verify wether it is 
possible to create a replica from this backup or not.

If the WAL segment for the specified restart_lsn (STOP_LSN of the 
backup) exists, then the function will create a physical replication 
slot and will keep all the WAL segments required by the replica to catch 
up with the primary. Otherwise, it returns error, which means that the 
required WAL segments have been already utilised, so we do need to take 
a new backup. Without passing this newly added parameter 
pg_create_physical_replication_slot() works as before.

What do you think about this?

-- 
Vyacheslav Makarov

Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
Attachment

pgsql-hackers by date:

Previous
From: Juan José Santamaría Flecha
Date:
Subject: Re: factorial of negative numbers
Next
From: Fujii Masao
Date:
Subject: Re: [patch] demote