Re: pgsql: Fix pg_dump assertion failure when dumping pg_catalog. - Mailing list pgsql-committers

From Tom Lane
Subject Re: pgsql: Fix pg_dump assertion failure when dumping pg_catalog.
Date
Msg-id 1149326.1693835764@sss.pgh.pa.us
Whole thread Raw
In response to Re: pgsql: Fix pg_dump assertion failure when dumping pg_catalog.  (Peter Eisentraut <peter@eisentraut.org>)
List pgsql-committers
Peter Eisentraut <peter@eisentraut.org> 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



pgsql-committers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: pgsql: Fix pg_dump assertion failure when dumping pg_catalog.
Next
From: Michael Paquier
Date:
Subject: pgsql: Improve description of keys in tsvector