From a8a477118e7df9316efa2e7f1cdf43d316b51a05 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 20 Mar 2021 01:55:59 -0500
Subject: [PATCH 7/9] attcompression is a list of chars, and never null

Robert seems to have noticed half of this here: CA+TgmoYRsapWz2vDSQXFAEL_BAMq1aY37avcq9GAB=SUUvFhaw@mail.gmail.com
---
 src/bin/pg_dump/pg_dump.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index f8bec3ffcc..aa7c004147 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -8759,7 +8759,7 @@ getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables)
 		tbinfo->attcollation = (Oid *) pg_malloc(ntups * sizeof(Oid));
 		tbinfo->attfdwoptions = (char **) pg_malloc(ntups * sizeof(char *));
 		tbinfo->attmissingval = (char **) pg_malloc(ntups * sizeof(char *));
-		tbinfo->attcompression = (char *) pg_malloc(ntups * sizeof(char *));
+		tbinfo->attcompression = (char *) pg_malloc(ntups * sizeof(char));
 		tbinfo->notnull = (bool *) pg_malloc(ntups * sizeof(bool));
 		tbinfo->inhNotNull = (bool *) pg_malloc(ntups * sizeof(bool));
 		tbinfo->attrdefs = (AttrDefInfo **) pg_malloc(ntups * sizeof(AttrDefInfo *));
@@ -15908,8 +15908,7 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo)
 					/*
 					 * Attribute compression
 					 */
-					if (!dopt->no_toast_compression &&
-						tbinfo->attcompression != NULL)
+					if (!dopt->no_toast_compression)
 					{
 						char	   *cmname;
 
-- 
2.17.0

