This is an automated email from the ASF dual-hosted git repository.

yjhjstz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git

commit 226a8ef8949c39229736647fc2d875e76183a1b5
Author: Brent Doil <[email protected]>
AuthorDate: Wed Feb 15 21:10:16 2023 -0500

    In binary upgrade, dump the encoding clause for dropped columns
    
    The encoding clause is necessary to maintain catalog consistency
    for dropped columns in pg_attribute_encoding across major version
    upgrades. Without this, the column encoding will be set to the
    hardcoded server default in the new cluster. If the encoding was
    modified from the default in the old cluster, an error would occur
    if the column needed to be scanned for any reason.
    
    Resolves the issue `ERROR:  decompression information missing` after
    a column is dropped from an AO/CO table and the table is run through 
pg_upgrade
    
    Authored-by: Brent Doil <[email protected]>
---
 src/bin/pg_dump/pg_dump.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 1b5d41796a..fc42c8eb4c 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -18267,7 +18267,15 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo)
                                                 * clean things up later.
                                                 */
                                                appendPQExpBufferStr(q, " 
INTEGER /* dummy */");
-                                               /* and skip to the next column 
*/
+
+                                               /* Dropped columns are dumped 
during binary upgrade.
+                                                * Dump the encoding clause 
also to maintain a consistent
+                                                * catalog entry in 
pg_attribute_encoding post upgrade.
+                                                */
+                                               if (tbinfo->attencoding[j] != 
NULL)
+                                                       appendPQExpBuffer(q, " 
ENCODING (%s)", tbinfo->attencoding[j]);
+
+                                               /* Skip all the rest */
                                                continue;
                                        }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to