Adding C collate on initdb

PostgreSQL has a problem to sort some non-latin characters using `ORDER BY` and the known solution is setting `LC_COLLATE` to C.[1][2] Because `LC_COLLATE` is fixed when running `initdb`, it is preclusive to set collation on post installation script for new user.

[1]: https://stackoverflow.com/questions/14191848/postgresql-order-by-is-very-weird
[2]: https://stackoverflow.com/questions/43745639/sort-order-in-postgresql-for-japanese-words-in-hiragana
This commit is contained in:
gnsngck 2018-05-26 01:43:38 +09:00 committed by GitHub
parent e5c9981b1a
commit 6662c173b7

View File

@ -25,7 +25,7 @@
"PGDATA": "$dir\\data" "PGDATA": "$dir\\data"
}, },
"post_install": " "post_install": "
if (!(Test-Path \"$dir\\data\\pg_hba.conf\")) { iex \"initdb --username=postgres --encoding=UTF8 --locale=en\" } if (!(Test-Path \"$dir\\data\\pg_hba.conf\")) { iex \"initdb --username=postgres --encoding=UTF8 --locale=en --lc-collate=c\" }
", ",
"notes": "To start/stop service, run `pg_ctl start`, `pg_ctl stop`.", "notes": "To start/stop service, run `pg_ctl start`, `pg_ctl stop`.",
"checkver": { "checkver": {