]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix \dRp+ output when describing publications with a lower server version.
authorAmit Kapila <akapila@postgresql.org>
Wed, 22 Jan 2025 09:57:37 +0000 (15:27 +0530)
committerAmit Kapila <akapila@postgresql.org>
Wed, 22 Jan 2025 09:57:37 +0000 (15:27 +0530)
The psql was not careful that the new column "Generated columns" won't be
present in the lower version. This was introduced in recent commit
7054186c4e.

Author: Vignesh C
Reviewed-by: Peter Smith
Discussion: https://postgr.es/m/CALDaNm3OcXdY0EzDEKAfaK9gq2B67Mfsgxu93+_249ohyts=0g@mail.gmail.com

src/bin/psql/describe.c

index 2ef99971ac01b7af2e9d2f0a6a55d5795f3042ce..8c0ad8439eb236ff4471911a5caf1c9d63977de4 100644 (file)
@@ -6495,12 +6495,23 @@ describePublications(const char *pattern)
        if (has_pubtruncate)
                appendPQExpBufferStr(&buf,
                                                         ", pubtruncate");
+       else
+               appendPQExpBufferStr(&buf,
+                                                        ", false AS pubtruncate");
+
        if (has_pubgencols)
                appendPQExpBufferStr(&buf,
                                                         ", pubgencols");
+       else
+               appendPQExpBufferStr(&buf,
+                                                        ", false AS pubgencols");
+
        if (has_pubviaroot)
                appendPQExpBufferStr(&buf,
                                                         ", pubviaroot");
+       else
+               appendPQExpBufferStr(&buf,
+                                                        ", false AS pubviaroot");
 
        appendPQExpBufferStr(&buf,
                                                 "\nFROM pg_catalog.pg_publication\n");