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: Fri, 10 Sep 2021 13:47:48 +0700
Message-ID: <0ad8d349-8857-bcb1-8dea-64a393017713@postgrespro.ru> (raw)
In-Reply-To: <3723477.1631212672@sss.pgh.pa.us>
References: <429d64ee-188d-3ce1-106a-53a8b45c4fce@postgrespro.ru>
	<3607308.1631199070@sss.pgh.pa.us>
	<2fee0074-8ae8-20bd-ad94-0b22dcd7585e@postgrespro.ru>
	<3723477.1631212672@sss.pgh.pa.us>

On 10/09/2021 01:37, Tom Lane wrote:
> Another approach we could take is to deem the comment incorrect and
> just remove it, codifying the current behavior of silently ignoring
> unrecognized encodings.  The reason that seems like it might be
> appropriate is that the logic immediately below this bit silently
> ignores encodings that are known but are frontend-only:
> 
>              if (!PG_VALID_BE_ENCODING(enc))
>                  continue;        /* ignore locales for client-only encodings */
> 
> It's sure not very clear to me why one case deserves a message and the
> other not.  Perhaps they both do, which would lead to adding another
> DEBUG1 message here.

I'm not an expert in locales, but I think it makes some sense to be 
silent about encodings we have consciously decided to ignore as we have 
them in our tables, but marked them as frontend-only 
(!PG_VALID_BE_ENCODING(enc)).
Just like it makes sense to do give a debug-level warning about 
encodings seen in locale -a output but not recognized by us at all 
(pg_get_encoding_from_locale(localebuf, false) < 0).

Therefore I think your patch with duplicated error message is better 
than what we have currently. I don't see how adding debug-level messages 
about skipping frontend-only encodings would be of any significant use here.

Unless someone more experienced in locales' subtleties would like to 
chime in.

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





view thread (7+ messages)  latest in thread

Message-ID: <0ad8d349-8857-bcb1-8dea-64a393017713@postgrespro.ru>
Permalink:  ../0ad8d349-8857-bcb1-8dea-64a393017713@postgrespro.ru/
Also on:    postgresql.org/message-id/0ad8d349-8857-bcb1-8dea-64a393017713@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: <0ad8d349-8857-bcb1-8dea-64a393017713@postgrespro.ru>
  References: <429d64ee-188d-3ce1-106a-53a8b45c4fce@postgrespro.ru> <3607308.1631199070@sss.pgh.pa.us> <2fee0074-8ae8-20bd-ad94-0b22dcd7585e@postgrespro.ru> <3723477.1631212672@sss.pgh.pa.us> <0ad8d349-8857-bcb1-8dea-64a393017713@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