Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating utf-8 database in Postgresql on Windows10

Tags:

postgresql

I am trying to create utf-8 database on windows 10:

createdb.exe -h localhost -p 53131 -U user -E UTF8 -T template0 -l en_US.utf-8 test777

But response is:

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

Any clues?

like image 935
Tomasz Dziurko Avatar asked Nov 18 '16 09:11

Tomasz Dziurko


1 Answers

You should use "English_United States" or "en-US", see the Microsoft documentation about locale names.

PostgreSQL allows the creation of a UTF8 database with any locale on Windows (see the documentation).

By the way, the initdb option for specifying the locale is --locale and not -l.

like image 111
Laurenz Albe Avatar answered Oct 20 '22 06:10

Laurenz Albe