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 1mODo9-00062h-29 for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Sep 2021 06:45:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mODo6-0001sU-VP for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Sep 2021 06:45:10 +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 1mODo6-0001sI-LY for pgsql-hackers@lists.postgresql.org; Thu, 09 Sep 2021 06:45:10 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mODo3-0006oh-S7 for pgsql-hackers@postgresql.org; Thu, 09 Sep 2021 06:45:10 +0000 Received: from [192.168.28.74] (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 234CE21C7A95 for ; Thu, 9 Sep 2021 09:45:06 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1631169906; bh=u+fa6BbWKVIxoWcOEuIymEjGFc7px/5dVBWB+KamEz8=; h=To:From:Subject:Date; b=IG7P6lVc5vV5ISD69WCo1rBo272IHA9tXKXjeYZM1VY2NBAZBLjyPymbJRARyJD/l iGO4NwCwsyj4dLXGw7f3npYNbiKc1i2kslny7hEQK6yYIqwBYKVQeoAIzhIJoDb1U7 Fhk105iLI4SOdKhudFhf8GQ1LNBYNjuUWkop5DoI= To: Pg Hackers From: Anton Voloshin Subject: missing warning in pg_import_system_collations Message-ID: <429d64ee-188d-3ce1-106a-53a8b45c4fce@postgrespro.ru> Date: Thu, 9 Sep 2021 13:45:05 +0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------A6A3CA2171B28027F676A15F" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------A6A3CA2171B28027F676A15F Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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). Introduced in aa17c06fb in January 2017 when debug was replaced by false, so I guess back-patching through 10 would be appropriate. -- Anton Voloshin Postgres Professional, The Russian Postgres Company https://postgrespro.ru --------------A6A3CA2171B28027F676A15F Content-Type: text/x-patch; charset=UTF-8; name="pg_import_system_collations-warning.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pg_import_system_collations-warning.patch" diff --git a/src/backend/commands/collationcmds.c b/src/backend/commands/collationcmds.c index 4075f991a03..b601ca4d68c 100644 --- a/src/backend/commands/collationcmds.c +++ b/src/backend/commands/collationcmds.c @@ -594,7 +594,7 @@ pg_import_system_collations(PG_FUNCTION_ARGS) continue; } - enc = pg_get_encoding_from_locale(localebuf, false); + enc = pg_get_encoding_from_locale(localebuf, /*write_message=*/true); if (enc < 0) { /* error message printed by pg_get_encoding_from_locale() */ --------------A6A3CA2171B28027F676A15F--