The problem of creating a Postgresql database with localization

as the output of this command

createdb -E UTF8 --lc-collate=hr_HR.UTF8 --lc-ctype=hr_HR.UTF8 tempdb 

I get

 createdb: database creation failed: ERROR: invalid locale name hr_HR.UTF8 

I am noob in postgresql, so any help would be appreciated! As you can see from the above command, I need to create a database with support for the Croatian language. My OS:

 Linux tiho-desktop 2.6.31-20-generic #58-Ubuntu SMP Fri Mar 12 04:38:19 UTC 2010 x86_64 GNU/Linux 

and it is only for development. I plan to move this database to CentOS or something like this for production. I am using postgresql 8.4.

Thanks in advance, Tiho

+4
source share
1 answer

what do you get as output locale -a | grep hr_HR locale -a | grep hr_HR ?

I can not reproduce the error, because my createdb does not accept locale parameters (it seems that the option is only available in 8.4 ), but you should check that the locale that you set exists in the output of the above command. In addition, you do not need to specify collapse and ctype separately: the -l switch covers both.

+3
source

Source: https://habr.com/ru/post/1308175/


All Articles