Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set locale to C.UTF-8 when creating database clusters #746

Merged
merged 1 commit into from Oct 21, 2022

Conversation

syvb
Copy link
Contributor

@syvb syvb commented Oct 6, 2022

Fixes #691 by setting the locale to C.UTF-8 when creating databases.

On macOS the C.UTF-8 locale doesn't exist so the locale is set to C and the CTYPE to UTF-8, which has the same effect as setting the locale to C.UTF-8 on other operating systems.

Note that testing this requires creating a new database cluster. I tested this by:

  • reinstalling cargo-pgx
  • deleting ~/.pgx
  • rerunning cargo pgx init to get a new database cluster
  • cleaning the target directory of any repos you want to test this on

@workingjubilee
Copy link
Member

@thomcc Do you think this handling of the locale setting is correct for Mac?

Note that testing this requires:
- reinstalling cargo-pgx
- deleting `~/.pgx`
- rerunning `cargo pgx init` to get a new database cluster
- cleaning the target directory of any repos you want to test this on
@thomcc
Copy link
Contributor

thomcc commented Oct 19, 2022

@thomcc Do you think this handling of the locale setting is correct for Mac?

Sorry, I didn't see this. Yes, it looks correct (assuming that those arguments to initdb work as I'd expect).

Copy link
Contributor

@eeeebbbbrrrr eeeebbbbrrrr left a comment

Choose a reason for hiding this comment

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

I approve.

I now wonder about pgx extensions running in a non-UTF8 database. But that's a different problem for a different day.

@workingjubilee workingjubilee merged commit 58ed5e6 into pgcentralfoundation:develop Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants