Setting postgresql default database locale

UPDATE pg_database SET datallowconn = TRUE WHERE datname = 'template0';
UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1';
drop database template1;
CREATE DATABASE template1 ENCODING = 'utf8' TEMPLATE = template0 LC_CTYPE ='en_US.utf8' LC_COLLATE = 'en_US.utf8';
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template1';
UPDATE pg_database SET datallowconn = FALSE WHERE datname = 'template0';

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Advertisements
%d bloggers like this: