Skip to content

Conversation

@syvb
Copy link
Contributor

@syvb syvb commented Nov 22, 2022

CentOS 7 doesn't support the C.UTF-8 locale, so cargo-pgx doesn't work on CentOS 7 since it tries to set a databases locale to C.UTF-8. Rocky Linux >= 8 does have the C.UTF-8 locale and works fine.

This PR makes pgx fallback to the C locale on systems without the C.UTF-8 locale (according to locale, and defaulting to C if locale fails to run).

@syvb syvb force-pushed the sv/locale-name-fix branch from 71bf5f4 to 98a64c0 Compare November 22, 2022 18:36
@syvb syvb force-pushed the sv/locale-name-fix branch from 98a64c0 to 0630a25 Compare November 22, 2022 18:37
@workingjubilee
Copy link
Member

Hm. Please document this fallback logic in one of our READMEs somewhere? It's getting complicated enough that users should be aware of the system differences.

@syvb
Copy link
Contributor Author

syvb commented Nov 22, 2022

I documented the locale behavior for the cargo pgx test and cargo pgx start/stop commands.

Copy link
Member

@workingjubilee workingjubilee left a comment

Choose a reason for hiding this comment

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

Thank you. Hopefully no one will have to care, but inevitably someone is going to want to, say, port software from CentOS 7 to Rocky Linux 8.

Just one other nit.

syvb and others added 2 commits November 22, 2022 17:05
Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>
@workingjubilee workingjubilee merged commit 1cda3da into pgcentralfoundation:develop Nov 22, 2022
@workingjubilee workingjubilee mentioned this pull request Dec 1, 2022
usamoi pushed a commit to tensorchord/pgrx that referenced this pull request Mar 6, 2025
)

* Fallback to C locale on systems without C.UTF-8
* Document pgx locale behavior

* Simplify locale checking

Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>

* clarify comment


Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>
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.

2 participants