Re: Problem while restoring a database from SQL_ASCII to UTF-8

From: Peter Geoghegan <peter(at)2ndquadrant(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
Cc: Manoj Agarwal <ma(at)ockham(dot)be>, pgsql-general(at)postgresql(dot)org
Subject: Re: Problem while restoring a database from SQL_ASCII to UTF-8
Date: 2012-06-06 13:37:14
Message-ID: CAEYLb_UAVouJP7fnN7qhbO7KmcJ4HG0b+kh2ef95dh4xKB6wEg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 6 June 2012 14:12, Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com> wrote:
> SQL_ASCII is not an encoding, it is basically a way of saying encoding
> ignored. Given that, outside knowledge of the encoding used for data
> inserted into the database is needed to make the conversion to UTF8. In
> other words do you have any idea of what encoding was used by the clients
> that supplied data to the database?

You're going to have to manage this process carefully. I believe the
best tool for the job is pgloader:

http://pgfoundry.org/projects/pgloader/

It's certainly not inconceivable that this sort of tool could
automagically deduce encoding (albeit often inconclusively) in much
the same manor as modern web browsers attempt to when they have no
alternative. I don't see much demand for that though.

--
Peter Geoghegan       http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training and Services

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2012-06-06 14:05:55 Re: I'd like to learn a bit more about how indexes work
Previous Message Adrian Klaver 2012-06-06 13:12:59 Re: Problem while restoring a database from SQL_ASCII to UTF-8