Re: Problem while restoring a database from SQL_ASCII to UTF-8 - Mailing list pgsql-general

From Manoj Agarwal
Subject Re: Problem while restoring a database from SQL_ASCII to UTF-8
Date
Msg-id 000a01cd4559$51dc2440$f5946cc0$@ockham.be
Whole thread Raw
In response to Re: Problem while restoring a database from SQL_ASCII to UTF-8  (Adrian Klaver <adrian.klaver@gmail.com>)
List pgsql-general
Hi,

I took a slightly different approach to fix the issue.  There is a CPAN
module called Encoding::FixLatin, that takes mixed encoding input and
produces UTF-8 output.  It can be downloaded from the following link:

http://search.cpan.org/dist/Encoding-FixLatin/lib/Encoding/FixLatin.pm

This module takes input which may contain characters in more than one
encoding and makes a best effort to convert them all to UTF-8 output.  I
took the dump from Postgresql 7.4.19 database where encoding was SQL_ASCII.
Then I created a new database in UTF-8 in Postgresql 8.4.9.  Then I
installed the above Perl module.  After installing the module, I used the
following command to restore SQL_ASCII database to UTF-8:
pg_restore -O db_dump_sql_ascii | fix_latin | psql -d db_utf

The conversion was done successfully without any errors.   The database was
restored as UTF-8.

Kind Regards,
Manoj Agarwal

-----Original Message-----
From: Adrian Klaver [mailto:adrian.klaver@gmail.com]
Sent: Friday, June 08, 2012 2:19 AM
To: Manoj Agarwal
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Problem while restoring a database from SQL_ASCII to
UTF-8

On 06/06/2012 08:30 PM, Manoj Agarwal wrote:
> Hi,
>
> The encoding that is used by the clients that supplied data to the
> database is ISO-8859-1.

I meant to ask in my previous post:

1) What are the special characters causing the problem?

2) What is the data type for the fields holding these characters?

>
> Kind Regards,
> Manoj Agarwal


--
Adrian Klaver
adrian.klaver@gmail.com


pgsql-general by date:

Previous
From: "Marc Watson"
Date:
Subject: Re: Postgres 9.2 beta2 one-click installer on windows
Next
From: Craig Ringer
Date:
Subject: Re: Postgres 9.2 beta2 one-click installer on windows