summaryrefslogtreecommitdiff
path: root/src/bin/psql
diff options
context:
space:
mode:
authorAmit Kapila2025-01-23 09:58:37 +0000
committerAmit Kapila2025-01-23 09:58:37 +0000
commite65dbc9927fb86aa3c8a914ede6a6ae934384f5a (patch)
treebaf5c64867d7376c40135fc115860c1339087204 /src/bin/psql
parenteef4a33f62f7300765b5ffa8c966fa2fba50d176 (diff)
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 <[email protected]> Reviewed-by: Peter Smith <[email protected]> Reviewed-by: Peter Eisentraut <[email protected]> Reviewed-by: Amit Kapila <[email protected]> Discussion: https://postgr.es/m/[email protected] Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'src/bin/psql')
-rw-r--r--src/bin/psql/describe.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 8c0ad8439eb..2e84b61f184 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -24,6 +24,7 @@
#include "catalog/pg_constraint_d.h"
#include "catalog/pg_default_acl_d.h"
#include "catalog/pg_proc_d.h"
+#include "catalog/pg_publication_d.h"
#include "catalog/pg_statistic_ext_d.h"
#include "catalog/pg_subscription_d.h"
#include "catalog/pg_type_d.h"
@@ -6372,7 +6373,12 @@ listPublications(const char *pattern)
gettext_noop("Truncates"));
if (pset.sversion >= 180000)
appendPQExpBuffer(&buf,
- ",\n pubgencols AS \"%s\"",
+ ",\n (CASE pubgencols_type\n"
+ " WHEN '%c' THEN 'none'\n"
+ " WHEN '%c' THEN 'stored'\n"
+ " END) AS \"%s\"",
+ PUBLISH_GENCOLS_NONE,
+ PUBLISH_GENCOLS_STORED,
gettext_noop("Generated columns"));
if (pset.sversion >= 130000)
appendPQExpBuffer(&buf,
@@ -6500,11 +6506,17 @@ describePublications(const char *pattern)
", false AS pubtruncate");
if (has_pubgencols)
- appendPQExpBufferStr(&buf,
- ", pubgencols");
+ appendPQExpBuffer(&buf,
+ ", (CASE pubgencols_type\n"
+ " WHEN '%c' THEN 'none'\n"
+ " WHEN '%c' THEN 'stored'\n"
+ " END) AS \"%s\"\n",
+ PUBLISH_GENCOLS_NONE,
+ PUBLISH_GENCOLS_STORED,
+ gettext_noop("Generated columns"));
else
appendPQExpBufferStr(&buf,
- ", false AS pubgencols");
+ ", 'none' AS pubgencols");
if (has_pubviaroot)
appendPQExpBufferStr(&buf,