question

thuyerpacb-3723 avatar image
0 Votes"
thuyerpacb-3723 asked Mike-Ubezzi commented

how to use locale en_US.UTF-8 on azure postgresql

i try to create new database with locale en_US.UTF-8 but get error

createdb -h serverName -p 5432 -U user@serverName --template="template0" -E UNICODE -O user "newDatabase";

i get bellow error:

createdb: error: database creation failed: ERROR: invalid locale name: "en_US.UTF-8"

azure-database-postgresql
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

LeonLaude avatar image
0 Votes"
LeonLaude answered LeonLaude edited
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

thuyerpacb-3723 avatar image
0 Votes"
thuyerpacb-3723 answered Mike-Ubezzi commented

thanks for response, i'm not sure what's OS of azure postgres

base on my experimental with linux (centos, debian) OS support every locale but need to active it first

yeb. not standard locale is hell, i get it before, so i also with bellow list

createdb: error: database creation failed: ERROR: invalid locale name: "en-US.UTF-8"
createdb: error: database creation failed: ERROR: invalid locale name: "en-US.UTF8"
createdb: error: database creation failed: ERROR: invalid locale name: "en-US.UTF_8"
createdb: error: database creation failed: ERROR: invalid locale name: "en-US.utf-8"
createdb: error: database creation failed: ERROR: invalid locale name: "en-US.utf8"
createdb: error: database creation failed: ERROR: invalid locale name: "en-US.utf_8"
createdb: error: database creation failed: ERROR: invalid locale name: "en_US.UTF8"
createdb: error: database creation failed: ERROR: invalid locale name: "en_US.UTF-8"
createdb: error: database creation failed: ERROR: invalid locale name: "en_US.UTF_8"
createdb: error: database creation failed: ERROR: invalid locale name: "en_US.utf_8"
createdb: error: database creation failed: ERROR: invalid locale name: "en_US.utf-8"

--lc-collate en_US.utf8 --lc-ctype en_US.utf8
WARNING: Provided locale is invalid. Proceeding with collate = "en-US", ctype = "en-US"
=> this one success with warning

--lc-collate en-US --lc-ctype en-US
=> by warring change to this and success without warning


10293-azure.png


locale info is a bit difference from my server. it missing utf8 part

10303-myserver.png



azure.png (41.2 KiB)
myserver.png (19.1 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@thuyerpacb-3723 If you are looking to create a database with a specific collation, please see: How do I change 'LC_COLLATE' and 'LC_CTYPE' from an azure database for PostgreSQL?. This will explain the steps. Is there a specific issue you are facing?


0 Votes 0 ·