pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix pg_dump assertion failure when dumping pg_catalog.
6+ messages / 3 participants
[nested] [flat]

* pgsql: Fix pg_dump assertion failure when dumping pg_catalog.
@ 2023-08-22 20:08  Jeff Davis <jdavis@postgresql.org>
  0 siblings, 2 replies; 6+ messages in thread

From: Jeff Davis @ 2023-08-22 20:08 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix pg_dump assertion failure when dumping pg_catalog.

Commit 396d348b04 did not account for the default collation.

Also, use pg_log_warning() instead of Assert().

Discussion: https://postgr.es/m/ce071503fee88334aa70f360e6e4ea14d48305ee.camel%40j-davis.com
Reviewed-by: Michael Paquier
Backpatch-through: 15

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/37188cea0c16f3f27ec65b526ffe12f6469142fc

Modified Files
--------------
src/bin/pg_dump/pg_dump.c        | 69 ++++++++++++++++++++++++++++++----------
src/bin/pg_dump/t/002_pg_dump.pl |  8 +++++
2 files changed, 61 insertions(+), 16 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix pg_dump assertion failure when dumping pg_catalog.
@ 2023-08-22 20:08  Jeff Davis <jdavis@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Jeff Davis @ 2023-08-22 20:08 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix pg_dump assertion failure when dumping pg_catalog.

Commit 396d348b04 did not account for the default collation.

Also, use pg_log_warning() instead of Assert().

Discussion: https://postgr.es/m/ce071503fee88334aa70f360e6e4ea14d48305ee.camel%40j-davis.com
Reviewed-by: Michael Paquier
Backpatch-through: 15

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/501704e826fc75d7d1c8976a8d177f8ce3ea0b4c

Modified Files
--------------
src/bin/pg_dump/pg_dump.c        | 69 ++++++++++++++++++++++++++++++----------
src/bin/pg_dump/t/002_pg_dump.pl |  8 +++++
2 files changed, 61 insertions(+), 16 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix pg_dump assertion failure when dumping pg_catalog.
@ 2023-08-22 20:08  Jeff Davis <jdavis@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Jeff Davis @ 2023-08-22 20:08 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix pg_dump assertion failure when dumping pg_catalog.

Commit 396d348b04 did not account for the default collation.

Also, use pg_log_warning() instead of Assert().

Discussion: https://postgr.es/m/ce071503fee88334aa70f360e6e4ea14d48305ee.camel%40j-davis.com
Reviewed-by: Michael Paquier
Backpatch-through: 15

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/1d9976d1bd0067099753820c427139696d38b4a1

Modified Files
--------------
src/bin/pg_dump/pg_dump.c        | 57 +++++++++++++++++++++++++++++++++-------
src/bin/pg_dump/t/002_pg_dump.pl |  8 ++++++
2 files changed, 55 insertions(+), 10 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pgsql: Fix pg_dump assertion failure when dumping pg_catalog.
@ 2023-08-23 10:24  Peter Eisentraut <peter@eisentraut.org>
  parent: Jeff Davis <jdavis@postgresql.org>
  1 sibling, 0 replies; 6+ messages in thread

From: Peter Eisentraut @ 2023-08-23 10:24 UTC (permalink / raw)
  To: Jeff Davis <jdavis@postgresql.org>; pgsql-committers@lists.postgresql.org

On 22.08.23 22:08, Jeff Davis wrote:
> Fix pg_dump assertion failure when dumping pg_catalog.
> 
> Commit 396d348b04 did not account for the default collation.
> 
> Also, use pg_log_warning() instead of Assert().

Looking at this:

     pg_log_warning("invalid collation \"%s\"", qcollname);

qcollname is already a quoted identifier, so this message would be 
doubly quoted.  Maybe you should use collinfo->dobj.name in the messages.

Also, for

     pg_fatal("unrecognized collation provider '%c'", collprovider[0]);

use double quotes.






^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pgsql: Fix pg_dump assertion failure when dumping pg_catalog.
@ 2023-09-04 12:58  Peter Eisentraut <peter@eisentraut.org>
  parent: Jeff Davis <jdavis@postgresql.org>
  1 sibling, 1 reply; 6+ messages in thread

From: Peter Eisentraut @ 2023-09-04 12:58 UTC (permalink / raw)
  To: Jeff Davis <jdavis@postgresql.org>; pgsql-committers@lists.postgresql.org

On 22.08.23 22:08, Jeff Davis wrote:
> Fix pg_dump assertion failure when dumping pg_catalog.
> 
> Commit 396d348b04 did not account for the default collation.
> 
> Also, use pg_log_warning() instead of Assert().
> 
> Discussion: https://postgr.es/m/ce071503fee88334aa70f360e6e4ea14d48305ee.camel%40j-davis.com
> Reviewed-by: Michael Paquier
> Backpatch-through: 15

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.






^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pgsql: Fix pg_dump assertion failure when dumping pg_catalog.
@ 2023-09-04 13:56  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2023-09-04 13:56 UTC (permalink / raw)
  To: Peter Eisentraut <peter@eisentraut.org>; +Cc: Jeff Davis <jdavis@postgresql.org>; pgsql-committers@lists.postgresql.org

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





^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2023-09-04 13:56 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-08-22 20:08 pgsql: Fix pg_dump assertion failure when dumping pg_catalog. Jeff Davis <jdavis@postgresql.org>
2023-08-23 10:24 ` Peter Eisentraut <peter@eisentraut.org>
2023-09-04 12:58 ` Peter Eisentraut <peter@eisentraut.org>
2023-09-04 13:56   ` Tom Lane <tgl@sss.pgh.pa.us>
2023-08-22 20:08 pgsql: Fix pg_dump assertion failure when dumping pg_catalog. Jeff Davis <jdavis@postgresql.org>
2023-08-22 20:08 pgsql: Fix pg_dump assertion failure when dumping pg_catalog. Jeff Davis <jdavis@postgresql.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox