Re: Added schema level support for publication.

From: vignesh C <vignesh21(at)gmail(dot)com>
To: "tanghy(dot)fnst(at)fujitsu(dot)com" <tanghy(dot)fnst(at)fujitsu(dot)com>
Cc: Rahila Syed <rahilasyed90(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Ajin Cherian <itsajin(at)gmail(dot)com>
Subject: Re: Added schema level support for publication.
Date: 2021-06-30 11:43:21
Message-ID: CALDaNm3CtHhQOdZfCJgdQpV_93pp1n0DiPNBPpJZ-FWkdZTh4w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jun 29, 2021 at 8:55 AM tanghy(dot)fnst(at)fujitsu(dot)com <
tanghy(dot)fnst(at)fujitsu(dot)com> wrote:
>
> On Friday, June 25, 2021 2:25 AM vignesh C <vignesh21(at)gmail(dot)com>wrote:
> >
> > Thanks for reporting these warnings, I have fixed this in the v8 patch
> > attached at [1].
> > [1] - https://www.postgresql.org/message-
> > id/CALDaNm044P_cds1OxZvFse5rE_qQfhbUg5MdtMgsa7t_bZGJdw%40mail.
> > gmail.com
> >
>
> Thanks for your patch. The warnings are fixed.
>
> But I found an issue while using your V8 patch, which is similar to [1].
The case is as below:
> Drop a schema from publication and refresh publication at subscriber,
then insert into publisher table, the inserts still replicated to
subscriber. The expect result is that the data is no longer replicated.
>
> For example:
> ------publisher------
> create schema s1;
> create table s1.t1 (a int primary key);
> create publication pub for schema s1;
>
> ------subscriber------
> create schema s1;
> create table s1.t1 (a int primary key);
> create subscription sub connection 'dbname=postgres port=5432'
publication pub;
>
> ------publisher------
> insert into s1.t1 values (1);
>
> ------subscriber------
> postgres=# select * from s1.t1;
> a
> ---
> 1
> (1 row)
>
> ------publisher------
> alter publication pub drop schema s1;
> insert into s1.t1 values (2);
>
> ------subscriber------
> postgres=# select * from s1.t1;
> a
> ---
> 1
> 2
> (2 rows)
>

Thanks for reporting this issue, the attached v9 patch fixes this issue.
This also fixes the other issue you reported at [1].

[1] -
https://www.postgresql.org/message-id/OS0PR01MB61138278359AE713EA24140DFB019%40OS0PR01MB6113.jpnprd01.prod.outlook.com

Regards,
Vignesh

Attachment Content-Type Size
v9-0001-Added-schema-level-support-for-publication.patch text/x-patch 92.1 KB
v9-0002-Tests-and-documentation-for-schema-level-support-.patch text/x-patch 44.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2021-06-30 11:48:14 Re: Use PG_STAT_GET_REPLICATION_SLOT_COLS in pg_stat_get_replication_slot()
Previous Message Andrey Lepikhov 2021-06-30 11:21:15 Re: Removing unneeded self joins