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
Written by Marc Wilson
Related protips
1 Response
Add your response
Add your response
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
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Python
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#