Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit69e31d0

Browse files
committed
Improve log messages from pg_import_system_collations().
pg_import_system_collations() was a bit inconsistent about how itreported locales (names output by "locale -a") that it didn't makepg_collation entries for. IMV we should print some suitable messagefor every locale that we reject, except when it matches a pre-existingpg_collation entry. (This is all at DEBUG1 log level, though, so asnot to create noise during initdb.) Add messages for the two casesthat were previously not logged, namely unrecognized encoding andclient-only encoding. Re-word the existing messages to have aconsistent style.Anton Voloshin and Tom LaneDiscussion:https://postgr.es/m/429d64ee-188d-3ce1-106a-53a8b45c4fce@postgrespro.ru
1 parent2e4eae8 commit69e31d0

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

‎src/backend/commands/collationcmds.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ pg_import_system_collations(PG_FUNCTION_ARGS)
576576

577577
if (len==0||localebuf[len-1]!='\n')
578578
{
579-
elog(DEBUG1,"localename toolong, skipped: \"%s\"",localebuf);
579+
elog(DEBUG1,"skippinglocalewith too-long name: \"%s\"",localebuf);
580580
continue;
581581
}
582582
localebuf[len-1]='\0';
@@ -590,18 +590,22 @@ pg_import_system_collations(PG_FUNCTION_ARGS)
590590
*/
591591
if (!pg_is_ascii(localebuf))
592592
{
593-
elog(DEBUG1,"localename hasnon-ASCIIcharacters, skipped: \"%s\"",localebuf);
593+
elog(DEBUG1,"skippinglocalewithnon-ASCIIname: \"%s\"",localebuf);
594594
continue;
595595
}
596596

597597
enc=pg_get_encoding_from_locale(localebuf, false);
598598
if (enc<0)
599599
{
600-
/* error message printed by pg_get_encoding_from_locale() */
600+
elog(DEBUG1,"skipping locale with unrecognized encoding: \"%s\"",
601+
localebuf);
601602
continue;
602603
}
603604
if (!PG_VALID_BE_ENCODING(enc))
604-
continue;/* ignore locales for client-only encodings */
605+
{
606+
elog(DEBUG1,"skipping locale with client-only encoding: \"%s\"",localebuf);
607+
continue;
608+
}
605609
if (enc==PG_SQL_ASCII)
606610
continue;/* C/POSIX are already in the catalog */
607611

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp