RE: Added schema level support for publication.
tanghy.fnst@fujitsu.com <tanghy.fnst@fujitsu.com>
From: "tanghy.fnst@fujitsu.com" <tanghy.fnst@fujitsu.com>
To: vignesh C <vignesh21@gmail.com>
Cc: Masahiko Sawada <sawada.mshk@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Amit Kapila <amit.kapila16@gmail.com>, Peter Smith <smithpb2250@gmail.com>, Peter Eisentraut <peter.eisentraut@enterprisedb.com>, Greg Nancarrow <gregn4422@gmail.com>, Ajin Cherian <itsajin@gmail.com>, "houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>, Rahila Syed <rahilasyed90@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Date: 2021-09-01T05:44:45Z
Lists: pgsql-hackers
> On Monday, August 30, 2021 11:28 PM vignesh C <vignesh21@gmail.com> wrote:
>
> I have fixed these comments as part of v23 patch attached at [1].
> [1] - https://www.postgresql.org/message-
> id/CALDaNm0xmqJeQEfV5Wnj2BawM%3DsdFdfOXz5N%2BgGG3WB6k9%3Dtdw
> %40mail.gmail.com
>
Thanks for your new patch. Here are some comments on v23 patch.
1. doc/src/sgml/ref/alter_publication.sgml
+ <para>
+ Add some schemas to the publication:
+<programlisting>
+ALTER PUBLICATION sales_publication ADD ALL TABLES IN SCHEMA marketing_june, sales_june;
+</programlisting>
+ </para>
This change seems to be added twice, both 0003 and 0004 patch have this change.
2. src/sgml/ref/create_publication.sgml
There is the following description about "FOR TABLE" parameter:
Only persistent base tables and partitioned tables can be part of a
publication. Temporary tables, unlogged tables, foreign tables,
materialized views, and regular views cannot be part of a publication.
"FOR ALL TABLES IN SCHEMA" parameter also have restrictions, should we add
some doc description for it?
3. When using '\dn+', I noticed that the list of publications only contains the
publications for "SCHEMA", "FOR ALL TABLES" publications are not shown. Is it designed on purpose?
(The result of '\d+' lists the publications of "SCHEAME" and "FOR ALL TABLES").
For example:
create schema sch1;
create table sch1.tbl(a int);
create publication pub_schema for all tables in schema sch1;
create publication pub_all_tables for all tables;
postgres=# \d+ sch1.tbl
Table "sch1.tbl"
Column | Type | Collation | Nullable | Default | Storage | Compression | Stats target | Description
--------+---------+-----------+----------+---------+---------+-------------+--------------+-------------
a | integer | | | | plain | | |
Publications:
"pub_all_tables"
"pub_schema"
Access method: heap
postgres=# \dn+ sch1
List of schemas
Name | Owner | Access privileges | Description
------+----------+-------------------+-------------
sch1 | postgres | |
Publications:
"pub_schema"
Regards
Tang
Commits
-
Include schema/table publications even with exclude options in dump.
- 4aa6fa3cd0a2 18.0 landed
-
Rename some enums to use TABLE instead of REL.
- b3812d0b9bcf 15.0 landed
-
Add tap tests for the schema publications.
- 6b0f6f79eef2 15.0 landed
-
Allow publishing the tables of schema.
- 5a2832465fd8 15.0 landed
-
In pg_dump, use simplehash.h to look up dumpable objects by OID.
- 92316a4582a5 15.0 cited