Re: pg_basebackup --create-slot-if-not-exists?

Поиск
Список
Период
Сортировка
Искать
От
David G. Johnston
Тема
Re: pg_basebackup --create-slot-if-not-exists?
Дата
Msg-id
CAKFQuwa-a=hGJViDy1egn95RAUpj=UycpcVMuMhqXdY1kr-Gqw@mail.gmail.com
Ответ на
Список
Дерево обсуждения
pg_basebackup --create-slot-if-not-exists? Ashwin Agrawal <ashwinstar@gmail.com>
Re: pg_basebackup --create-slot-if-not-exists? "David G. Johnston" <david.g.johnston@gmail.com>
Re: pg_basebackup --create-slot-if-not-exists? Ashwin Agrawal <ashwinstar@gmail.com>
Re: pg_basebackup --create-slot-if-not-exists? Michael Paquier <michael@paquier.xyz>
Re: pg_basebackup --create-slot-if-not-exists? Tom Lane <tgl@sss.pgh.pa.us>
Re: pg_basebackup --create-slot-if-not-exists? Michael Banck <mbanck@gmx.net>
On Wednesday, September 21, 2022, Ashwin Agrawal <ashwinstar@gmail.com> wrote:
Currently, pg_basebackup has
--create-slot option to create slot if not already exists or
--slot to use existing slot

Which means it needs knowledge on if the slot with the given name already exists or not before invoking the command. If pg_basebackup --create-slot <> command fails for some reason after creating the slot. Re-triggering the same command fails with ERROR slot already exists. Either then need to delete the slot and retrigger Or need to add a check before retriggering the command to check if the slot exists and based on the same alter the command to avoid passing --create-slot option. This poses inconvenience while automating on top of pg_basebackup. As checking for slot presence before invoking pg_basebackup unnecessarily involves issuing separate SQL commands. Would be really helpful for such scenarios if similar to CREATE TABLE, pg_basebackup can have IF NOT EXISTS kind of semantic. (Seems the limitation most likely is coming from CREATE REPLICATION SLOT protocol itself), Thoughts?

What’s the use case for automating pg_basebackup with a named replication slot created by the pg_basebackup command?  Why can you not leverage a temporary replication slot (i.e., omit —slot). ISTM the create option is basically obsolete now.

David J.

В списке pgsql-hackers по дате отправления
От: Justin Pryzby
Дата:
От: Michael Paquier
Дата:
FAQ