Skip to content

Commit

Permalink
Improved locale env vars safety during installation for postgresql
Browse files Browse the repository at this point in the history
It was found that an LC_CTYPE=UTF-8 from iTerm2 on OSX was breaking the hub package install.

PostgreSQL docs suggest using 'C' locale unless otherwise needed
https://www.postgresql.org/docs/current/locale.html

> The drawback of using locales other than C or POSIX in PostgreSQL is its performance impact. It slows character handling and prevents ordinary indexes from being used by LIKE. For this reason use locales only if you actually need them.

Ticket: ENT-10739
Changelog: title
  • Loading branch information
craigcomstock committed Oct 6, 2023
1 parent 43003bd commit ac5b5ac
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions packaging/common/cfengine-hub/postinstall.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export LC_ALL=C # force C locale as recommended by postgresql docs
# (re)load SELinux policy if available and required before we start working with
# our daemons and services below
if [ `os_type` = "redhat" ] &&
Expand Down
2 changes: 2 additions & 0 deletions packaging/common/cfengine-hub/preinstall.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export LC_ALL=C # force C locale as recommended by postgresql docs


if is_upgrade; then
# This is nice to know to provide fixes for bugs in already released
Expand Down
2 changes: 2 additions & 0 deletions packaging/common/script-templates/script-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
unset LANG
unset LC_ADDRESS
unset LC_ALL
unset LC_CTYPE
unset LC_COLLATE
unset LC_IDENTIFICATION
unset LC_MEASUREMENT
unset LC_MONETARY
Expand Down

0 comments on commit ac5b5ac

Please sign in to comment.