Tuesday, March 20, 2012

How to create a database in PostgreSQL

Today I needed to create a database with SQL_ASCII encoding.

Here is the command I used:

CREATE DATABASE MyDB ENCODING 'SQL_ASCII' TEMPLATE template0;
I had to use template0 because template1 was set to UTF8.

I still need to dig in on the templates and what they are all about.