pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Anton Voloshin <a.voloshin@postgrespro.ru>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Subject: Re: missing warning in pg_import_system_collations
Date: Thu, 9 Sep 2021 22:17:35 +0700
Message-ID: <2fee0074-8ae8-20bd-ad94-0b22dcd7585e@postgrespro.ru> (raw)
In-Reply-To: <3607308.1631199070@sss.pgh.pa.us>
References: <429d64ee-188d-3ce1-106a-53a8b45c4fce@postgrespro.ru>
	<3607308.1631199070@sss.pgh.pa.us>

On 09/09/2021 21:51, Tom Lane wrote:
> What you propose to do here would promote this case from
> ought-to-be-DEBUG1 to WARNING, which seems to me to be way too much in the
> user's face.  Or, if there actually is a case for complaining, then all
> those messages ought to be WARNING not DEBUG1. ...
> 
> Assuming we don't want to change pg_get_encoding_from_locale()'s API,
> the simplest fix is to duplicate its error message, so more or less
> 
>       if (enc < 0)
>       {
> -        /* error message printed by pg_get_encoding_from_locale() */
> +        elog(DEBUG1, "could not determine encoding for locale \"%s\"",
> +             localebuf)));
>           continue;
>       }

Upon thinking a little more, I agree.
The warnings I happen to get from initdb on my current machine (with 
many various locales installed, more than on a typical box) are:

performing post-bootstrap initialization ... 2021-09-09 22:04:01.678 +07 
[482312] WARNING:  could not determine encoding for locale 
"hy_AM.armscii8": codeset is "ARMSCII-8"
2021-09-09 22:04:01.679 +07 [482312] WARNING:  could not determine 
encoding for locale "ka_GE": codeset is "GEORGIAN-PS"
2021-09-09 22:04:01.679 +07 [482312] WARNING:  could not determine 
encoding for locale "kk_KZ": codeset is "PT154"
2021-09-09 22:04:01.679 +07 [482312] WARNING:  could not determine 
encoding for locale "kk_KZ.rk1048": codeset is "RK1048"
2021-09-09 22:04:01.686 +07 [482312] WARNING:  could not determine 
encoding for locale "tg_TJ": codeset is "KOI8-T"
2021-09-09 22:04:01.686 +07 [482312] WARNING:  could not determine 
encoding for locale "th_TH": codeset is "TIS-620"
ok

While they are definitely interesting as DEBUG1, not so as a WARNING.

So, +1 from me for your proposed elog(DEBUG1, ...); patch. Thank you.

-- 
Anton Voloshin
Postgres Professional, The Russian Postgres Company
https://postgrespro.ru





view thread (7+ messages)  latest in thread

Message-ID: <2fee0074-8ae8-20bd-ad94-0b22dcd7585e@postgrespro.ru>
Permalink:  ../2fee0074-8ae8-20bd-ad94-0b22dcd7585e@postgrespro.ru/
Also on:    postgresql.org/message-id/2fee0074-8ae8-20bd-ad94-0b22dcd7585e@postgrespro.ru

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: a.voloshin@postgrespro.ru, tgl@sss.pgh.pa.us, peter.eisentraut@enterprisedb.com
  Subject: Re: missing warning in pg_import_system_collations
  In-Reply-To: <2fee0074-8ae8-20bd-ad94-0b22dcd7585e@postgrespro.ru>
  References: <429d64ee-188d-3ce1-106a-53a8b45c4fce@postgrespro.ru> <3607308.1631199070@sss.pgh.pa.us> <2fee0074-8ae8-20bd-ad94-0b22dcd7585e@postgrespro.ru>

* 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