Re: Added schema level support for publication.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: "tanghy(dot)fnst(at)fujitsu(dot)com" <tanghy(dot)fnst(at)fujitsu(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, "houzj(dot)fnst(at)fujitsu(dot)com" <houzj(dot)fnst(at)fujitsu(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, 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-09-14 04:02:49
Message-ID: 555773.1631592169@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> writes:
> On Mon, Sep 13, 2021 at 7:06 PM tanghy(dot)fnst(at)fujitsu(dot)com
> <tanghy(dot)fnst(at)fujitsu(dot)com> wrote:
>> I think if I use 'ALTER PUBLICATION ... SET', both the list of tables and the
>> list of all tables in schemas should be reset. The publication should only
>> contain the tables and all tables in schemas which user specified. If user only
>> specified all tables in schema, and didn't specify tables, the tables which used
>> to be part of the publication should be dropped, too. But currently, if I didn't
>> specify tables, the list of tables wouldn't be set to empty. Thoughts?

> I think we can go either way here but it seems like we should drop the
> tables in the case you mentioned. The idea is that the SET variant in
> ALTER PUBLICATION should replace the set of tables and schemas for the
> publication which seems to be in line with the current behavior where
> we replace the set of tables.

Yeah, I think it's sensible to define that there is just one SET variant
that replaces both the list-of-tables and the list-of-schemas. (Of
course, the syntax for it has to permit both lists to be written.)
You could imagine having two independent SET commands for the two lists,
but that seems fairly confusing.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2021-09-14 04:28:01 Re: Added schema level support for publication.
Previous Message Alexander Lakhin 2021-09-14 04:00:00 Re: Don't clean up LLVM state when exiting in a bad way