Re: missing warning in pg_import_system_collations

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Anton Voloshin <a(dot)voloshin(at)postgrespro(dot)ru>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: missing warning in pg_import_system_collations
Date: 2021-09-09 11:46:25
Message-ID: CAEudQArVn++oaJbV=Drug4RxbfE7WZ0GzxS1poWbW5L8LxTT=Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Em qui., 9 de set. de 2021 às 03:45, Anton Voloshin <
a(dot)voloshin(at)postgrespro(dot)ru> escreveu:

> Hello hackers,
>
> In pg_import_system_collations() there is this fragment of code:
>
> enc = pg_get_encoding_from_locale(localebuf, false);
> if (enc < 0)
> {
> /* error message printed by pg_get_encoding_from_locale() */
> continue;
> }
>
> However, false passed to pg_get_encoding_from_locale() means
> write_message argument is false, so no error message is ever printed.
> I propose an obvious patch (see attachment).
>
Yeah, seems correct to me.
The comment clearly expresses the intention.

> Introduced in aa17c06fb in January 2017 when debug was replaced by
> false, so I guess back-patching through 10 would be appropriate.
>
This is an oversight.

+1 from me.

Ranier Vilela

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Christoph Berg 2021-09-09 11:52:41 trap instead of error on 32 TiB table
Previous Message Amul Sul 2021-09-09 11:18:16 TAP test for recovery_end_command