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

Locale(s) can not be set / won't be generated @setup #161

Open
clauspruefer opened this issue Sep 2, 2023 · 0 comments
Open

Locale(s) can not be set / won't be generated @setup #161

clauspruefer opened this issue Sep 2, 2023 · 0 comments

Comments

@clauspruefer
Copy link

It should be possible to provide a "unix"-locale (or multiple locales) at setup time to specify result-ordering, monetary, number and time formating in different languages.

The default locale is not suitable for e.g. german language where characters ä,ö,ü,ß are essential. Also US date format is not readable by the most german citizens.

The following process describes how to generate locale(s) and to configure it. It should of course be possible to define all the locale settings (parameters) in the kubegres .yaml config-files.

1. Choose correct locale(s) / generate

    1. vim /etc/locale.gen
    1. locale-gen

Of course put the locale(s) specified in the kubegres config inside /etc/locale.gen and locale-gen inside docker container!

2. Set for initb cluster-creation (or in postgresql.conf)

It is possible to set the locales in postgresql.conf file or as initdb parameter.

Example (Canadian French global, Monetary US style):
initdb --locale=fr_CA --lc-monetary=en_US

The following locales can be set (according to postgresq-15 documentation):

Constant Description
LC_COLLATE String sort order
LC_CTYPE Character classification (What is a letter? Its upper-case equivalent?)
LC_MESSAGES Language of messages
LC_MONETARY Formatting of currency amounts
LC_NUMERIC Formatting of numbers
LC_TIME Formatting of dates and times

**Also i think they forgot "LC_ALL" **

Implementors should consider: locale settings can be set in 3 different ways

  1. postresql.conf
  2. initdb (parameters)
  3. Shell environment

Also parameter naming could be slightly different for the given ways!

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

No branches or pull requests

1 participant