a2ftvw
Last Updated: February 25, 2016
·
17.96K
· marcgwilson

Create Postgres database with UTF-8 encoding

Switch to the postgres user:<br>
sudo su postgres<br><br>
Execute the postgres createdb command:<br>
createdb <dbname> --encoding='utf-8' --locale=en_US.utf8 --template=template0;<br><br>
List the databases from psql:<br>
psql<br>
\l<br><br>
Quit back to the previous user:<br>
exit

Say Thanks
Respond

1 Response
Add your response

9428
0472784bda0180fa289d12eb0a0068df

Don't forget to add the name.
Also if you are using the createdb command you are in your commandline so no need for the ;

createdb -E UTF8 -T template0 --locale=en_US.utf8 <name>
over 1 year ago ·