views:

80

answers:

1

Hi everyone,

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'm a noob in postgresql so any help will be appreciated! As you can see from above command, I need to create database with support for Croatian language. My OS is:

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 it for production. I'm using postgresql 8.4.

Thanks in advance, Tiho

+1  A: 

Hi Tiho, what do you get as the output of locale -a | grep hr_HR?

I can't reproduce the error you get because my createdb doesn't accept the locale parameters (seems the option is only available in 8.4), but you should check that the locale you're setting exists in the output of the above command. Also, you don't need to specify the collaction and ctype separately: the -l switch covers both.

Tomislav Nakic-Alfirevic
Tomislav,thanks on quick answer. I already solved my problem simply. You have right about localization support on my machine. The solution for my problem was command: sudo locale-gen hr_HR.UTF-8. :-) Now everything works fine.P.S.: thanks on observation about -l switch. I'll need it in future. :-)Thanks again and best regards,Tiho
Tiho