Skip to content

Commit

Permalink
Merge pull request #9721 from neondatabase/skyzh/locale-changes
Browse files Browse the repository at this point in the history
cherry-pick Clean up C.UTF-8 locale changes
  • Loading branch information
skyzh authored Nov 11, 2024
2 parents b24850b + 96d66a2 commit 61ff18d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
15 changes: 11 additions & 4 deletions compute_tools/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,17 @@ pub fn write_postgres_conf(
}

// Locales
writeln!(file, "lc_messages='C.UTF-8'")?;
writeln!(file, "lc_monetary='C.UTF-8'")?;
writeln!(file, "lc_time='C.UTF-8'")?;
writeln!(file, "lc_numeric='C.UTF-8'")?;
if cfg!(target_os = "macos") {
writeln!(file, "lc_messages='C'")?;
writeln!(file, "lc_monetary='C'")?;
writeln!(file, "lc_time='C'")?;
writeln!(file, "lc_numeric='C'")?;
} else {
writeln!(file, "lc_messages='C.UTF-8'")?;
writeln!(file, "lc_monetary='C.UTF-8'")?;
writeln!(file, "lc_time='C.UTF-8'")?;
writeln!(file, "lc_numeric='C.UTF-8'")?;
}

match spec.mode {
ComputeMode::Primary => {}
Expand Down
6 changes: 5 additions & 1 deletion libs/pageserver_api/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,11 @@ pub mod defaults {
pub const DEFAULT_WAL_REDO_TIMEOUT: &str = "60 s";

pub const DEFAULT_SUPERUSER: &str = "cloud_admin";
pub const DEFAULT_LOCALE: &str = "C.UTF-8";
pub const DEFAULT_LOCALE: &str = if cfg!(target_os = "macos") {
"C"
} else {
"C.UTF-8"
};

pub const DEFAULT_PAGE_CACHE_SIZE: usize = 8192;
pub const DEFAULT_MAX_FILE_DESCRIPTORS: usize = 100;
Expand Down
6 changes: 0 additions & 6 deletions pageserver/src/tenant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4786,12 +4786,6 @@ async fn run_initdb(
.args(["--username", &conf.superuser])
.args(["--encoding", "utf8"])
.args(["--locale", &conf.locale])
.args(["--lc-collate", &conf.locale])
.args(["--lc-ctype", &conf.locale])
.args(["--lc-messages", &conf.locale])
.args(["--lc-monetary", &conf.locale])
.args(["--lc-numeric", &conf.locale])
.args(["--lc-time", &conf.locale])
.arg("--no-instructions")
.arg("--no-sync")
.env_clear()
Expand Down

1 comment on commit 61ff18d

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4760 tests run: 4580 passed, 0 failed, 180 skipped (full report)


Test coverage report is not available

The comment gets automatically updated with the latest test results
61ff18d at 2024-11-11T20:08:43.535Z :recycle:

Please sign in to comment.