Re: Added schema level support for publication.

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: vignesh C <vignesh21(at)gmail(dot)com>, "tanghy(dot)fnst(at)fujitsu(dot)com" <tanghy(dot)fnst(at)fujitsu(dot)com>, Greg Nancarrow <gregn4422(at)gmail(dot)com>, Ajin Cherian <itsajin(at)gmail(dot)com>, "houzj(dot)fnst(at)fujitsu(dot)com" <houzj(dot)fnst(at)fujitsu(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-08-15 20:34:44
Message-ID: CAD21AoB38nhq9K5B-9BjjKVaDO+SFPS3CwW0qC+8=8Ht0kQqVQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Aug 13, 2021 at 11:59 AM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> On Thu, Aug 12, 2021 at 5:54 PM Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
> >
> > On Fri, Aug 6, 2021 at 5:33 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:
> > >
> >
> > ---
> > Even if we drop all tables added to the publication from it, 'pubkind'
> > doesn't go back to 'empty'. Is that intentional behavior? If we do
> > that, we can save the lookup of pg_publication_rel and
> > pg_publication_schema in some cases, and we can switch the publication
> > that was created as FOR SCHEMA to FOR TABLE and vice versa.
> >
>
> Do we really want to allow users to change a publication that is FOR
> SCHEMA to FOR TABLE? I see that we don't allow to do that FOR TABLES.
> postgres=# Alter Publication pub add table tbl1;
> ERROR: publication "pub" is defined as FOR ALL TABLES
> DETAIL: Tables cannot be added to or dropped from FOR ALL TABLES publications.

When it comes to FOR ALL TABLES, we can neither add/drop tables
to/from the publication. So it makes sense to me that it never changes
to 'empty'. I'm not sure there are use cases in practice where to
change FOR SCHEMA to FOR TABLE. But it seems a bit weird to me that
pubkind doesn't change to "empty" even if the publication actually
gets empty. It might be just that "empty" is misleading, though.

Regards,

--
Masahiko Sawada
EDB: https://www.enterprisedb.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message otar shavadze 2021-08-15 20:52:45 Re: Get table total page quantity and cached page quantity
Previous Message David Rowley 2021-08-15 20:31:37 Re: Get table total page quantity and cached page quantity