Wednesday, July 25, 2018

[google-cloud-sql-discuss] Migrating Postgresql server to SQL Cloud and SQL_ASCII encoding

Hi All,

I am attempting to migrate a Postgres database server from our datacentre that's been around since the 90s (its now running  8.1.21) however the encoding type is "SQL_ASCII".

The error I get is:

postgres=>  CREATE DATABASE dbtest  ENCODING = 'SQL_ASCII';
ERROR:  encoding "SQL_ASCII" does not match locale "en_US.UTF8"
DETAIL:  The chosen LC_CTYPE setting requires encoding "UTF8".

Is there anything I can do to enable SQL_ASCII? 

I thought that ASCII was  subset of UTF8 so I was thinking this should be compatible.

I've dumped the DB, and changing the encoding to UTF8 (using sed -i -e 's/SQL_ASCII/UTF8/g' db-prod.sql) as the file is too big to open. 

However this resulted in import errors when copying our production database dump into a development project with things like.

ERROR:  invalid byte sequence for encoding "UTF8": 0x96

Has anyone done this before? 

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/27679962-15e0-42fc-ab61-1dfa30d24e6d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment