First, you need to supply the program versions.
Next, you need to understand that the default locale setting LC_CTYPE
is determined at cluster creation time. I quote the manual here:
Some locale categories must have their values fixed when the database
is created. You can use different settings for different databases,
but once a database is created, you cannot change them for that
database anymore. LC_COLLATE
and LC_CTYPE
are these categories. They
affect the sort order of indexes, so they must be kept fixed, or
indexes on text columns would become corrupt. (But you can alleviate
this restriction using collations, as discussed in Section 22.2.) The
default values for these categories are determined when initdb is run,
and those values are used when new databases are created, unless
specified otherwise in the CREATE DATABASE
command.
You can easily solve this with CREATE DATABASE
building on the template0
template database, which has no pre-determined objects in it.
CREATE DATABASE pana_development ENCODING 'LATIN1' TEMPLATE template0;
In Ruby, you can just supply a "template" parameter:
template: template0
Compare this closely related answer:
rake db:create encoding error with postgresql
For repeated use you should prepare a database like outlined above, put everything in it that you want in future databases and use this one as template. Any database can be used as template.
Or you create a new database cluster with matching LC_TYPE
and take it from there.