5

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 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

3 Comments

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
Is there a way to use "locale-gen" or similar on windows as I need to do the same thing ? (I know this is a bit old post but I'm having the same issue with PostgreSQL 9.3.2)
@khorvat Hi, maybe you can ask this as a new question hew on stackoverflow.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.