Skip to content

Commit af3abca

Browse files
committed
Allow initdb to complete on systems without "locale" command
This partially reverts 2fe3bdb, which added an error check on the "locale -a" execution. This is removed again, adding a comment explaining why. We already had code that shows a warning if no system locales could be found, which should be sufficient for feedback to the user. Discussion: https://www.postgresql.org/message-id/flat/b2b491d1-3b36-15b9-6910-5b5540b27f5c%40enterprisedb.com
1 parent 3b30454 commit af3abca

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/backend/commands/collationcmds.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,6 @@ pg_import_system_collations(PG_FUNCTION_ARGS)
640640
int naliases,
641641
maxaliases,
642642
i;
643-
int pclose_rc;
644643

645644
/* expansible array of aliases */
646645
maxaliases = 100;
@@ -747,15 +746,13 @@ pg_import_system_collations(PG_FUNCTION_ARGS)
747746
}
748747
}
749748

750-
pclose_rc = ClosePipeStream(locale_a_handle);
751-
if (pclose_rc != 0)
752-
{
753-
ereport(ERROR,
754-
(errcode_for_file_access(),
755-
errmsg("could not execute command \"%s\": %s",
756-
"locale -a",
757-
wait_result_to_str(pclose_rc))));
758-
}
749+
/*
750+
* We don't check the return value of this, because we want to support
751+
* the case where there "locale" command does not exist. (This is
752+
* unusual but can happen on minimalized Linux distributions, for
753+
* example.) We will warn below if no locales could be found.
754+
*/
755+
ClosePipeStream(locale_a_handle);
759756

760757
/*
761758
* Before processing the aliases, sort them by locale name. The point

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy