Add a GUC variable that control logical replication - Mailing list pgsql-hackers

From Quan Zongliang
Subject Add a GUC variable that control logical replication
Date
Msg-id ad20d5e9-b86e-42bc-3036-f1fda5e828a1@postgresdata.com
Whole thread Raw
Responses Re: Add a GUC variable that control logical replication
Re: Add a GUC variable that control logical replication
List 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

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: base backup client as auxiliary backend process
Next
From: Juan José Santamaría Flecha
Date:
Subject: Re: Allow to_date() and to_timestamp() to accept localized names