aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2022-11-17 12:12:11 +0100
committerPeter Eisentraut <peter@eisentraut.org>2022-11-17 12:12:11 +0100
commitaf3abca029b39ae6bdb683a758b11375e9839631 (patch)
tree99764f97300bf0b1c1404806670fa97bd907a054
parent3b304547a9dfef7101889d35a4c5da7866d66c8e (diff)
downloadpostgresql-af3abca029b39ae6bdb683a758b11375e9839631.tar.gz
postgresql-af3abca029b39ae6bdb683a758b11375e9839631.zip
Allow initdb to complete on systems without "locale" command
This partially reverts 2fe3bdbd691a5d11626308e7d660440be6c210c8, 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
-rw-r--r--src/backend/commands/collationcmds.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/backend/commands/collationcmds.c b/src/backend/commands/collationcmds.c
index e1429c7bf5f..81e54e0ce62 100644
--- a/src/backend/commands/collationcmds.c
+++ b/src/backend/commands/collationcmds.c
@@ -640,7 +640,6 @@ pg_import_system_collations(PG_FUNCTION_ARGS)
int naliases,
maxaliases,
i;
- int pclose_rc;
/* expansible array of aliases */
maxaliases = 100;
@@ -747,15 +746,13 @@ pg_import_system_collations(PG_FUNCTION_ARGS)
}
}
- pclose_rc = ClosePipeStream(locale_a_handle);
- if (pclose_rc != 0)
- {
- ereport(ERROR,
- (errcode_for_file_access(),
- errmsg("could not execute command \"%s\": %s",
- "locale -a",
- wait_result_to_str(pclose_rc))));
- }
+ /*
+ * We don't check the return value of this, because we want to support
+ * the case where there "locale" command does not exist. (This is
+ * unusual but can happen on minimalized Linux distributions, for
+ * example.) We will warn below if no locales could be found.
+ */
+ ClosePipeStream(locale_a_handle);
/*
* Before processing the aliases, sort them by locale name. The point