Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mOLo6-0002VL-1r for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Sep 2021 15:17:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mOLo4-0000xO-Ut for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Sep 2021 15:17:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mOLo4-0000xB-LU for pgsql-hackers@lists.postgresql.org; Thu, 09 Sep 2021 15:17:40 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mOLo2-00033x-4P for pgsql-hackers@postgresql.org; Thu, 09 Sep 2021 15:17:40 +0000 Received: from [192.168.28.142] (cyclops.postgrespro.ru [93.174.131.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id BF72421C5D68; Thu, 9 Sep 2021 18:17:36 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1631200657; bh=ShOl7WcWCcjBu7irUpmFjsYQdoQlhfUCSXkdLsBfGTw=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=eifp7UKV7V2MGKQY6v1+iZ+l0LHJVO2CKaS/Yr3Da+TXbr7VMdg93q5Qy/15f93cl OxtERLrAn0+hlZBy98OPuXJgEXZ0Pewk1Lm3XAWq89QjHD5NmLw5EncYnx6lOhViUU s7slr0Hk7uy9jSbMP2hj9x7C57cyN6sImalD2css= Subject: Re: missing warning in pg_import_system_collations To: Tom Lane Cc: Pg Hackers , Peter Eisentraut References: <429d64ee-188d-3ce1-106a-53a8b45c4fce@postgrespro.ru> <3607308.1631199070@sss.pgh.pa.us> From: Anton Voloshin Message-ID: <2fee0074-8ae8-20bd-ad94-0b22dcd7585e@postgrespro.ru> Date: Thu, 9 Sep 2021 22:17:35 +0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <3607308.1631199070@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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