Re: Added schema level support for publication.

vignesh C <vignesh21@gmail.com>

From: vignesh C <vignesh21@gmail.com>
To: "houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>
Cc: "tanghy.fnst@fujitsu.com" <tanghy.fnst@fujitsu.com>, Greg Nancarrow <gregn4422@gmail.com>, Masahiko Sawada <sawada.mshk@gmail.com>, Peter Eisentraut <peter.eisentraut@enterprisedb.com>, Tom Lane <tgl@sss.pgh.pa.us>, Peter Smith <smithpb2250@gmail.com>, Ajin Cherian <itsajin@gmail.com>, Rahila Syed <rahilasyed90@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>, Amit Kapila <amit.kapila16@gmail.com>
Date: 2021-10-12T13:15:02Z
Lists: pgsql-hackers

Attachments

On Tue, Oct 12, 2021 at 12:24 PM houzj.fnst@fujitsu.com
<houzj.fnst@fujitsu.com> wrote:
>
> On Monday, October 11, 2021 11:02 PM vignesh C <vignesh21@gmail.com> wrote:
> > The attached v39 patch has the fixes for the above issues.
>
> Thanks for the updates.
> I have a few minor suggestions about the testcases in the v39-0003-Test patch.
>
> 1)
> +-- alter publication drop CURRENT_SCHEMA
> +ALTER PUBLICATION testpub1_forschema DROP ALL TABLES IN SCHEMA CURRENT_SCHEMA;
> +\dRp+ testpub1_forschema
>
> Since we already tested CURRENT_SCHEMA in various CREATE PUBLICATION cases, maybe
> we don't need to test it again in SET/DROP/ADD cases.

Modified

> 2)
> +-- alter publication set schema
> +ALTER PUBLICATION testpub1_forschema SET ALL TABLES IN SCHEMA pub_test1;
> +\dRp+ testpub1_forschema
> +
> +-- alter publication set multiple schema
> +ALTER PUBLICATION testpub1_forschema SET ALL TABLES IN SCHEMA pub_test1, pub_test2;
> +\dRp+ testpub1_forschema
> +
>
> I think the multiple schemas testcase is sufficient, maybe we can remove the
> single schema case.

Modified

> 3)
> +
> +-- alter publication set it with the same schema
> +ALTER PUBLICATION testpub1_forschema SET ALL TABLES IN SCHEMA pub_test1, pub_test2;
> +\dRp+ testpub1_forschema
>
> ISTM, we didn't have some special code path for this case, maybe we can remove
> this testcase.

Modified

Attached v40 patch has the fix for the above comments.

Regards,
Vignesh

Commits

  1. Include schema/table publications even with exclude options in dump.

  2. Rename some enums to use TABLE instead of REL.

  3. Add tap tests for the schema publications.

  4. Allow publishing the tables of schema.

  5. In pg_dump, use simplehash.h to look up dumpable objects by OID.