Creating a UTF‑8 encoded Database requires at a minimum the encoding. Locale and collate can be specified as well, which will influence case-insensitive searching and sorting behavior:
# Minimum CREATE DATABASE "<db>" WITH OWNER '<user>' ENCODING 'UTF8'; # Explicit CREATE DATABASE "<db>" WITH OWNER '<user>' ENCODING 'UTF8' LC_COLLATE = 'en_US.UTF-8' LC_CTYPE = 'en_US.UTF-8';
psql utility will accept the above statement without a terminating
; but it will never execute it! Don’t forget the terminating semicolon!
Taken from this StackOverflow Answer