aboutsummaryrefslogtreecommitdiffstats
path: root/main/postgresql-common/postgresql.initd
diff options
context:
space:
mode:
Diffstat (limited to 'main/postgresql-common/postgresql.initd')
-rw-r--r--main/postgresql-common/postgresql.initd8
1 files changed, 7 insertions, 1 deletions
diff --git a/main/postgresql-common/postgresql.initd b/main/postgresql-common/postgresql.initd
index a4ba83c64c7..bb487f40cc5 100644
--- a/main/postgresql-common/postgresql.initd
+++ b/main/postgresql-common/postgresql.initd
@@ -30,7 +30,6 @@ description_setup="Initialize a new $name cluster"
: ${conf_dir:="/etc/postgresql"}
: ${logfile:="/var/log/postgresql/postmaster.log"}
: ${env_vars:=}
-: ${initdb_opts:=}
: ${pg_opts:=}
: ${port:=5432}
@@ -59,6 +58,7 @@ start_pre() {
check_deprecated_var rude_quit stop_fast_timeout
check_deprecated_var force_timeout stop_force_timeout
check_deprecated_var force_quit stop_force_timeout
+ check_deprecated_var env_vars 'export NAME=VALUE'
# For backward compatibility only.
[ "$rude_quit" = no ] && [ "stop_fast_timeout" -eq 10 ] && stop_fast_timeout=0
@@ -223,6 +223,12 @@ setup() {
eend 1 "$data_dir/base already exists!"; return 1
fi
+ if [ "$pg_version" -ge 15 ]; then
+ : ${initdb_opts:="-E UTF-8 --locale-provider=icu --icu-locale=en-001-x-icu --data-checksums"}
+ else
+ : ${initdb_opts:="-E UTF-8 --locale=C --data-checksums"}
+ fi
+
# If data_dir exists, backup configs.
if [ -d "$data_dir" ]; then
bkpdir="$(mktemp -d)"