-
Notifications
You must be signed in to change notification settings - Fork 19
Description
I've prepared a modification to setting collate and ctype during database creation.
Why is it important and necessary?
PostgreSQL uses en_GB.UTF-8 by default (on openSUSE), but this doesn't guarantee proper operation in the localized (e.g. CH, HU, PL, SK, etc...) environment. What do I mean by this?
If the locale does not match the users' language:
- sorting will be incorrect
- searching will not work properly
- LIKE operations will behave incorrectly
- LOWER/UPPER will work incorrectly
- regexes will be considered incorrect for certain accented characters
In practice, this causes very annoying errors in an ERP system that uses accented data.
The COLLATE and CTYPE values of a PostgreSQL database cannot be changed after creation. Therefore, it is important to set these values correctly when creating the database.
The modification I made, allows you to select the locale from a drop-down list when configuring database settings in the admin interface. The list contains the languages found in the locale directory that have UTF encoding.
If anybody has question or idea don't hesitate to share with me.