Add a GUC variable that control logical replication

Поиск
Список
Период
Сортировка
От Quan Zongliang
Тема Add a GUC variable that control logical replication
Дата
Msg-id ad20d5e9-b86e-42bc-3036-f1fda5e828a1@postgresdata.com
обсуждение исходный текст
Ответы Re: Add a GUC variable that control logical replication  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Re: Add a GUC variable that control logical replication  (Craig Ringer <craig@2ndquadrant.com>)
Список pgsql-hackers

Sybase has a feature to turn off replication at the session level: set 
replication = off, which can be temporarily turned off when there is a 
maintenance action on the table. Our users also want this feature.
I add a new flag bit in xinfo, control it with a session-level variable, 
when set to true, this flag is written when the transaction is 
committed, and when the logic is decoded it abandons the transaction 
like aborted transactions. Since PostgreSQL has two types of 
replication, I call the variable "logical_replication" to avoid 
confusion and default value is true.

Sample SQL

insert into a values(100);
set logical_replication to off;
insert into a values(200);
reset logical_replication;
insert into a values(300);

pg_recvlogical output(the second is not output.)
BEGIN 492
table public.a: INSERT: col1[integer]:100
COMMIT 492
BEGIN 494
table public.a: INSERT: col1[integer]:300
COMMIT 494

I'm not sure this is the most appropriate way. What do you think?

Regards,
Quan Zongliang

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: base backup client as auxiliary backend process
Следующее
От: Juan José Santamaría Flecha
Дата:
Сообщение: Re: Allow to_date() and to_timestamp() to accept localized names