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: Greg Nancarrow <gregn4422(at)gmail(dot)com>, Ajin Cherian <itsajin(at)gmail(dot)com>, Rahila Syed <rahilasyed90(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Subject: Re: Added schema level support for publication.
Date: 2021-07-21 17:29:44
Message-ID: CALDaNm0=MaXyAok5iq_-DeWUd81vpdF47-MZbbrsd+zB2P6WwA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jul 19, 2021 at 8:43 AM tanghy(dot)fnst(at)fujitsu(dot)com
<tanghy(dot)fnst(at)fujitsu(dot)com> wrote:
>
> On Friday, July 16, 2021 6:13 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:
>
> >
>
> > On Fri, Jul 16, 2021 at 9:25 AM Greg Nancarrow <mailto:gregn4422(at)gmail(dot)com> wrote:
>
> > >
>
> > > Also, there seems to be an issue with ALTER PUBLICATION ... SET SCHEMA ...
>
> > > (PubType is getting set to 'e' instead of 's'
>
> > >
>
> > > test_pub=# create publication pub1;
>
> > > CREATE PUBLICATION
>
> > > test_pub=# create table myschema.test(i int);
>
> > > CREATE TABLE
>
> > > test_pub=# alter publication pub1 set schema myschema;
>
> > > ALTER PUBLICATION
>
> > > test_pub=# \dRp pub1
>
> > > List of publications
>
> > > Name | Owner | All tables | Inserts | Updates | Deletes | Truncates |
>
> > > Via root | PubType
>
> > > ------+-------+------------+---------+---------+---------+-----------+----------+---------
>
> > > pub1 | gregn | f | t | t | t | t |
>
> > > f | e
>
> > > (1 row)
>
> > >
>
> > > test_pub=# alter publication pub1 add table test;
>
> > > ALTER PUBLICATION
>
> > > test_pub=# \dRp pub1
>
> > > List of publications
>
> > > Name | Owner | All tables | Inserts | Updates | Deletes | Truncates |
>
> > > Via root | PubType
>
> > > ------+-------+------------+---------+---------+---------+-----------+----------+---------
>
> > > pub1 | gregn | f | t | t | t | t |
>
> > > f | t
>
> > > (1 row)
>
> > >
>
> > >
>
> > > When I use "ADD SCHEMA" instead of "SET SCHEMA" on an empty
>
> > > publication, it seems OK.
>
> >
>
> > Modified.
>
> >
>
>
>
> Thanks for your patch. But there is a problem about "ALTER PUBLICATION … SET TABLE …", which is similar to the issue Greg reported at [1].
>
>
>
> For example:
>
> postgres=# CREATE TABLE public.t1 (a int);
>
> CREATE TABLE
>
> postgres=# CREATE PUBLICATION pub1;
>
> CREATE PUBLICATION
>
> postgres=# ALTER PUBLICATION pub1 SET TABLE public.t1;
>
> ALTER PUBLICATION
>
> postgres=# \dRp
>
> List of publications
>
> Name | Owner | All tables | Inserts | Updates | Deletes | Truncates | Via root | PubType
>
> ------+----------+------------+---------+---------+---------+-----------+----------+---------
>
> pub1 | postgres | f | t | t | t | t | f | e
>
> (1 row)
>
>
>
> I think PubType in this case should be 't' instead of 'e'. Please have a look.

Thanks for reporting this issue, this issue is fixed in the attached v13 patch.
I have changed relation name pg_publication_schema to
pg_publication_sch so that the names are in similar lines with
pg_publication_rel relation and similar changes were done for variable
names too.

Regards,
Vignesh

Attachment Content-Type Size
v13-0001-Added-schema-level-support-for-publication.patch text/x-patch 96.0 KB
v13-0002-Tests-and-documentation-for-schema-level-support.patch text/x-patch 45.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-07-21 17:29:49 Re: Have I found an interval arithmetic bug?
Previous Message vignesh C 2021-07-21 17:26:04 Re: Printing backtrace of postgres processes