Bug #5653
Migrate the database to UTF-8
Start date:
17/04/2018
Due date:
% Done:
0%
History
#1 Updated by Philippe May about 7 years ago
Was trying to clone the existing DB avgis, as it has "C" language. Following https://stackoverflow.com/questions/8806631/how-to-convert-a-db-in-postgresql-to-utf8 , where the steps are:
postgres pg_dump --encoding utf8 main -f main.sql createdb -E utf8 newMain psql -f main.sql -d newMain
postgres@gisaf:~$ pg_dump --encoding utf8 avgis -f avgis.sql
postgres@gisaf:~$ createdb -E utf8 avgis_utf8 createdb: database creation failed: ERROR: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII) HINT: Use the same encoding as in the template database, or use template0 as template.
The default locale on the server was "C". Changed it to en_IN (UTF-8).
Need to restart postgres, and see if the message persists.
#2 Updated by Philippe May about 7 years ago
Don't want to mess with pg metadata (change the default template: i'm not too confident), so the (advertised) command worked:
createdb -E utf8 -T template0 avgis_utf8
#3 Updated by Philippe May about 7 years ago
- Status changed from New to Closed
Importation, checked that the grants are also imported, and renamed the DB: all ok, apparently.