pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: Jeff Davis <pgsql@j-davis.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: pgsql-bugs@postgresql.org
Subject: Re: pg_dump assertion failure with "-n pg_catalog"
Date: Tue, 5 Sep 2023 11:45:33 +0200
Message-ID: <be43b547-3e28-769f-47d8-5b44f95facae@eisentraut.org> (raw)
In-Reply-To: <e7c1adfe66542eca348de7485990abfabdbc1086.camel@j-davis.com>
References: <ce071503fee88334aa70f360e6e4ea14d48305ee.camel@j-davis.com>
	<ZIbAuHfnWY05VxVt@paquier.xyz>
	<e7c1adfe66542eca348de7485990abfabdbc1086.camel@j-davis.com>

On 16.06.23 00:47, Jeff Davis wrote:
>   		else
>   		{
>   			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);
>   		}
>   

This new code replaces an (unexpected) null value with an empty string. 
Is that correct?  Empty locale strings have specific behaviors under the 
libc and icu providers.  It seems to me it would be better to error out 
or don't print a CREATE COLLATION command at all rather than 
substituting a value that is not a correct substitute.

Alternatively, a more correct way to produce a null value would be to 
not issue the assignment at all (omit the " lc_collation = " etc.). 
Then we can leave it up to the backend to accept the command or not, but 
at least the dump closely reflects the original catalog state.







view thread (8+ messages)  latest in thread

Message-ID: <be43b547-3e28-769f-47d8-5b44f95facae@eisentraut.org>
Permalink:  ../be43b547-3e28-769f-47d8-5b44f95facae@eisentraut.org/
Also on:    postgresql.org/message-id/be43b547-3e28-769f-47d8-5b44f95facae@eisentraut.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: peter@eisentraut.org, pgsql@j-davis.com, michael@paquier.xyz
  Subject: Re: pg_dump assertion failure with "-n pg_catalog"
  In-Reply-To: <be43b547-3e28-769f-47d8-5b44f95facae@eisentraut.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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