[PATCH] Allow to specify restart_lsn in pg_create_physical_replication_slot()

From: Vyacheslav Makarov <v(dot)makarov(at)postgrespro(dot)ru>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: [PATCH] Allow to specify restart_lsn in pg_create_physical_replication_slot()
Date: 2020-06-18 12:39:09
Message-ID: a7388f45d8744b17ec8b05beb20d84ea@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
Allow to specify restart_lsn in pg_create_physical_replication_slot().diff text/x-diff 8.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2020-06-18 12:41:45 Re: [patch] demote
Previous Message Juan José Santamaría Flecha 2020-06-18 12:19:10 Re: factorial of negative numbers