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