For the following MySQL create database statement, what would be the equivalent in postgresql?:
CREATE DATABASE IF NOT EXISTS `scratch`
DEFAULT CHARACTER SET = utf8
DEFAULT COLLATE = utf8_unicode_ci;
I currently have:
CREATE DATABASE "scratch"
WITH OWNER "postgres"
ENCODING 'UTF8'
TABLESPACE "pg_default";
Is that enough or should I be more specific including LOCALE
as well?
Yes, you can be more specific.
For example:
CREATE DATABASE "scratch"
WITH OWNER "postgres"
ENCODING 'UTF8'
LC_COLLATE = 'en_US.UTF-8'
LC_CTYPE = 'en_US.UTF-8';
Also I recommend to read the following pages about locales and collations in PostgreSQL: