Updating Postgres encoding

rails
ruby
postgresql

#1

Hi all,

I have forked a Ruby on Rails github repo and cloned into my c9 workspace and need some assistance with the Postgres set up. I receive this error message when trying to rake my database.

“PG::InvalidParameterValue: ERROR: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)”

The existing app is in unicode/UTF8 but c9’s default is ASCII; is there a way to update this configuration?


#2

You might need to enter Postgres CLI mode ($ sudo sudo -u postgres psql) and do something like this:

CREATE DATABASE template1 WITH TEMPLATE = template0 ENCODING = 'UNICODE';

Let me know if it helps.


#3

quite similar! i found the longform version of that in SO…here http://stackoverflow.com/questions/26545746/cloud9-postgres/29379969#29379969

Thank you!