Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qdA3v-002OW5-QI for pgsql-committers@arkaria.postgresql.org; Mon, 04 Sep 2023 13:56:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qdA3t-00BYvR-P9 for pgsql-committers@arkaria.postgresql.org; Mon, 04 Sep 2023 13:56:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qdA3t-00BYv8-H0 for pgsql-committers@lists.postgresql.org; Mon, 04 Sep 2023 13:56:17 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qdA3l-002zz4-IN; Mon, 04 Sep 2023 13:56:16 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 384Du4gj1149327; Mon, 4 Sep 2023 09:56:04 -0400 From: Tom Lane To: Peter Eisentraut cc: Jeff Davis , pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Fix pg_dump assertion failure when dumping pg_catalog. In-reply-to: <2a31d8ba-38e9-6335-8ba6-9d042c63473b@eisentraut.org> References: <2a31d8ba-38e9-6335-8ba6-9d042c63473b@eisentraut.org> Comments: In-reply-to Peter Eisentraut message dated "Mon, 04 Sep 2023 14:58:45 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1149325.1693835764.1@sss.pgh.pa.us> Date: Mon, 04 Sep 2023 09:56:04 -0400 Message-ID: <1149326.1693835764@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Peter Eisentraut writes: > I have another question about this patch. The original issue was that > it would trigger an Assert() inside pg_dump when some columns in > pg_collation were null that were not expected. This patch now contains > code like > appendPQExpBufferStr(q, ", lc_collate = "); > - appendStringLiteralAH(q, collcollate, fout); > + appendStringLiteralAH(q, collcollate ? collcollate : "", fout); > appendPQExpBufferStr(q, ", lc_ctype = "); > - appendStringLiteralAH(q, collctype, fout); > + appendStringLiteralAH(q, collctype ? collctype : "", fout); > which would produce pg_dump output like > CREATE COLLATION ... (provider = libc, lc_collate = , lc_ctype = ); > which is not valid syntax. How so? appendStringLiteral adds quotes around what it's given, empty string or no. The receiving server might or might not like those parameters semantically, but the syntax should be ok. regards, tom lane