Re: Added schema level support for publication.
Greg Nancarrow <gregn4422@gmail.com>
From: Greg Nancarrow <gregn4422@gmail.com>
To: vignesh C <vignesh21@gmail.com>
Cc: "houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>,
Ajin Cherian <itsajin@gmail.com>, Rahila Syed <rahilasyed90@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>, "tanghy.fnst@fujitsu.com" <tanghy.fnst@fujitsu.com>
Date: 2021-07-26T23:41:46Z
Lists: pgsql-hackers
On Mon, Jul 26, 2021 at 3:21 PM vignesh C <vignesh21@gmail.com> wrote:
>
> Thanks for the comment, this is modified in the v15 patch attached.
>
I have several minor review comments.
(1) src/backend/catalog/objectaddress.c
Should start comment sentences with an uppercase letter, for consistency.
+ /* fetch publication name and schema oid from input list */
I also notice that some 1-sentence comments end with "." (full-stop)
and others don't. It seems to alternate all over the place, and so is
quite noticeable.
Unfortunately, it already seems to be like this in much of the code
that this patch patches.
Ideally (at least my personal preference is) 1-sentence comments
should not end with a ".".
(2) src/backend/catalog/pg_publication.c
errdetail message
I think the following should say "Temporary schemas ..." (since the
existing error message for tables says "System tables cannot be added
to publications.").
+ errdetail("Temporary schema cannot be added to publications.")));
(3) src/backend/commands/publicationcmds.c
PublicationAddTables
I think that the Assert below is not correct (i.e. not restrictive enough).
Although the condition passes, it is allowing, for example,
stmt->for_all_tables==true if stmt->schemas==NIL, and that doesn't
seem to be correct.
I suggest the following change:
BEFORE:
+ Assert(!stmt || !stmt->for_all_tables || !stmt->schemas);
AFTER:
+ Assert(!stmt || (!stmt->for_all_tables && !stmt->schemas));
(4) src/backend/commands/publicationcmds.c
PublicationAddSchemas
Similarly, I think that the Assert below is not restrictive enough,
and think it should be changed:
BEFORE:
+ Assert(!stmt || !stmt->for_all_tables || !stmt->tables);
AFTER:
+ Assert(!stmt || (!stmt->for_all_tables && !stmt->tables));
(5) src/bin/pg_dump/common.c
Spelling mistake.
BEFORE:
+ pg_log_info("reading publciation schemas");
AFTER:
+ pg_log_info("reading publication schemas");
Regards,
Greg Nancarrow
Fujitsu Australia
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