Re: Added schema level support for publication.
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Smith <smithpb2250@gmail.com>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>,
Amit Kapila <amit.kapila16@gmail.com>,
Masahiko Sawada <sawada.mshk@gmail.com>,
vignesh C <vignesh21@gmail.com>,
"tanghy.fnst@fujitsu.com" <tanghy.fnst@fujitsu.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-08-16T13:31:18Z
Lists: pgsql-hackers
Peter Smith <smithpb2250@gmail.com> writes:
> Then the question from Peter E. [2] "Why can't I have a publication
> that publishes tables t1, t2, t3, *and* schemas s1, s2, s3." would
> have an intuitive solution like:
> CREATE PUBLICATION pub1
> FOR TABLE t1,t2,t3 AND
> FOR ALL TABLES IN SCHEMA s1,s2,s3;
That seems a bit awkward, since the existing precedent is
to use commas. We shouldn't need more than one FOR noise-word,
either. So I was imagining syntax more like, say,
CREATE PUBLICATION pub1 FOR
TABLE t1,t2,t3, ALL TABLES IN SCHEMA s1,s2,
SEQUENCE seq1,seq2, ALL SEQUENCES IN SCHEMA s3,s4;
Abstractly it'd be
createpub := CREATE PUBLICATION pubname FOR cpitem [, ... ] [ WITH ... ]
cpitem := ALL TABLES |
TABLE name |
ALL TABLES IN SCHEMA name |
ALL SEQUENCES |
SEQUENCE name |
ALL SEQUENCES IN SCHEMA name |
name
The grammar output would need some post-analysis to attribute the
right type to bare "name" items, but that doesn't seem difficult.
regards, tom lane
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