aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorAmit Kapila <akapila@postgresql.org>2025-01-23 15:28:37 +0530
committerAmit Kapila <akapila@postgresql.org>2025-01-23 15:28:37 +0530
commite65dbc9927fb86aa3c8a914ede6a6ae934384f5a (patch)
treebaf5c64867d7376c40135fc115860c1339087204 /doc/src
parenteef4a33f62f7300765b5ffa8c966fa2fba50d176 (diff)
downloadpostgresql-e65dbc9927fb86aa3c8a914ede6a6ae934384f5a.tar.gz
postgresql-e65dbc9927fb86aa3c8a914ede6a6ae934384f5a.zip
Change publication's publish_generated_columns option type to enum.
The current boolean publish_generated_columns option only supports a binary choice, which is insufficient for future enhancements where generated columns can be of different types (e.g., stored or virtual). The supported values for the publish_generated_columns option are 'none' and 'stored'. Author: Vignesh C <vignesh21@gmail.com> Reviewed-by: Peter Smith <smithpb2250@gmail.com> Reviewed-by: Peter Eisentraut <peter@eisentraut.org> Reviewed-by: Amit Kapila <amit.kapila16@gmail.com> Discussion: https://postgr.es/m/d718d219-dd47-4a33-bb97-56e8fc4da994@eisentraut.org Discussion: https://postgr.es/m/B80D17B2-2C8E-4C7D-87F2-E5B4BE3C069E@gmail.com
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/catalogs.sgml14
-rw-r--r--doc/src/sgml/ref/create_publication.sgml29
2 files changed, 34 insertions, 9 deletions
diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml
index d3036c5ba9d..c88bcaa7df9 100644
--- a/doc/src/sgml/catalogs.sgml
+++ b/doc/src/sgml/catalogs.sgml
@@ -6396,6 +6396,20 @@ SCRAM-SHA-256$<replaceable>&lt;iteration count&gt;</replaceable>:<replaceable>&l
<row>
<entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>pubgencols</structfield> <type>char</type>
+ </para>
+ <para>
+ Controls how to handle generated column replication when there is no
+ publication column list:
+ <literal>n</literal> = generated columns in the tables associated with
+ the publication should not be replicated,
+ <literal>s</literal> = stored generated columns in the tables associated
+ with the publication should be replicated.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
<structfield>pubviaroot</structfield> <type>bool</type>
</para>
<para>
diff --git a/doc/src/sgml/ref/create_publication.sgml b/doc/src/sgml/ref/create_publication.sgml
index 5e25536554a..e822ea2aaa9 100644
--- a/doc/src/sgml/ref/create_publication.sgml
+++ b/doc/src/sgml/ref/create_publication.sgml
@@ -89,10 +89,10 @@ CREATE PUBLICATION <replaceable class="parameter">name</replaceable>
<para>
When a column list is specified, only the named columns are replicated.
- The column list can contain generated columns as well. If no column list
- is specified, all table columns (except generated columns) are replicated
- through this publication, including any columns added later. It has no
- effect on <literal>TRUNCATE</literal> commands. See
+ The column list can contain stored generated columns as well. If no
+ column list is specified, all table columns (except generated columns)
+ are replicated through this publication, including any columns added
+ later. It has no effect on <literal>TRUNCATE</literal> commands. See
<xref linkend="logical-replication-col-lists"/> for details about column
lists.
</para>
@@ -190,20 +190,31 @@ CREATE PUBLICATION <replaceable class="parameter">name</replaceable>
</varlistentry>
<varlistentry id="sql-createpublication-params-with-publish-generated-columns">
- <term><literal>publish_generated_columns</literal> (<type>boolean</type>)</term>
+ <term><literal>publish_generated_columns</literal> (<type>enum</type>)</term>
<listitem>
<para>
Specifies whether the generated columns present in the tables
- associated with the publication should be replicated.
- The default is <literal>false</literal>.
+ associated with the publication should be replicated. Possible values
+ are <literal>none</literal> and <literal>stored</literal>.
+ </para>
+
+ <para>
+ The default is <literal>none</literal> meaning the generated
+ columns present in the tables associated with publication will not be
+ replicated.
+ </para>
+
+ <para>
+ If set to <literal>stored</literal>, the stored generated columns
+ present in the tables associated with publication will be replicated.
</para>
<note>
<para>
If the subscriber is from a release prior to 18, then initial table
synchronization won't copy generated columns even if parameter
- <literal>publish_generated_columns</literal> is true in the
- publisher.
+ <literal>publish_generated_columns</literal> is <literal>stored</literal>
+ in the publisher.
</para>
</note>
</listitem>