Re: Pgoutput not capturing the generated columns
Peter Smith <smithpb2250@gmail.com>
Attachments
- PS_NITPICKS_GENCOLS_V310001.txt (text/plain)
Review comments for v31-0001.
(I tried to give only new comments, but there might be some overlap
with comments I previously made for v30-0001)
======
src/backend/catalog/pg_publication.c
1.
+
+ if (publish_generated_columns_given)
+ {
+ values[Anum_pg_publication_pubgencolumns - 1] =
BoolGetDatum(publish_generated_columns);
+ replaces[Anum_pg_publication_pubgencolumns - 1] = true;
+ }
nit - unnecessary whitespace above here.
======
src/backend/replication/pgoutput/pgoutput.c
2. prepare_all_columns_bms
+ /* Iterate the cols until generated columns are found. */
+ cols = bms_add_member(cols, i + 1);
How does the comment relate to the statement that follows it?
~~~
3.
+ * Skip generated column if pubgencolumns option was not
+ * specified.
nit - /pubgencolumns option/publish_generated_columns parameter/
======
src/bin/pg_dump/pg_dump.c
4.
getPublications:
nit - /i_pub_gencolumns/i_pubgencols/ (it's the same information but simpler)
======
src/bin/pg_dump/pg_dump.h
5.
+ bool pubgencolumns;
} PublicationInfo;
nit - /pubgencolumns/pubgencols/ (it's the same information but simpler)
======
vsrc/bin/psql/describe.c
6.
bool has_pubviaroot;
+ bool has_pubgencol;
nit - /has_pubgencol/has_pubgencols/ (plural consistency)
======
src/include/catalog/pg_publication.h
7.
+ /* true if generated columns data should be published */
+ bool pubgencolumns;
} FormData_pg_publication;
nit - /pubgencolumns/pubgencols/ (it's the same information but simpler)
~~~
8.
+ bool pubgencolumns;
PublicationActions pubactions;
} Publication;
nit - /pubgencolumns/pubgencols/ (it's the same information but simpler)
======
src/test/regress/sql/publication.sql
9.
+-- Test the publication with or without 'PUBLISH_GENERATED_COLUMNS' parameter
+SET client_min_messages = 'ERROR';
+CREATE PUBLICATION pub1 FOR ALL TABLES WITH (PUBLISH_GENERATED_COLUMNS=1);
+\dRp+ pub1
+
+CREATE PUBLICATION pub2 FOR ALL TABLES WITH (PUBLISH_GENERATED_COLUMNS=0);
+\dRp+ pub2
9a.
nit - Use lowercase for the parameters.
~
9b.
nit - Fix the comment to say what the test is actually doing:
"Test the publication 'publish_generated_columns' parameter enabled or disabled"
======
src/test/subscription/t/031_column_list.pl
10.
Later I think you should add another test here to cover the scenario
that I was discussing with Sawada-San -- e.g. when there are 2
publications for the same table subscribed by just 1 subscription but
having different values of the 'publish_generated_columns' for the
publications.
======
Kind Regards,
Peter Smith.
Fujitsu Australia
Commits
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Doc: Generated column replication.
- 6252b1eaf82b 18.0 landed
-
Rename pubgencols_type to pubgencols in pg_publication.
- 75eb9766ec20 18.0 landed
-
Doc: Fix column name in pg_publication catalog.
- 117f9f328e0f 18.0 landed
-
Fix buildfarm failure introduced by commit e65dbc9927.
- b35434b134b1 18.0 landed
-
Change publication's publish_generated_columns option type to enum.
- e65dbc9927fb 18.0 landed
-
Fix \dRp+ output when describing publications with a lower server version.
- 991974bb4888 18.0 landed
-
Replicate generated columns when 'publish_generated_columns' is set.
- 7054186c4ebe 18.0 landed
-
Doc: Update the behavior of generated columns in Logical Replication.
- 5b0c46ea0932 18.0 landed
-
Replicate generated columns when specified in the column list.
- 745217a051a9 18.0 landed
-
Doc: Generated columns are skipped for logical replication.
- 7a089f6e6a14 17.0 cited