Re: [GENERAL] How do I copy part of table from db1 to db2 (and - Mailing list pgsql-sql

From Tom Lane
Subject Re: [GENERAL] How do I copy part of table from db1 to db2 (and
Date
Msg-id 1677.1125498589@sss.pgh.pa.us
Whole thread Raw
In response to Re: [GENERAL] How do I copy part of table from db1 to db2 (and  (Joost Kraaijeveld <J.Kraaijeveld@Askesis.nl>)
Responses Re: [GENERAL] How do I copy part of table from db1 to db2  (Joost Kraaijeveld <J.Kraaijeveld@Askesis.nl>)
List pgsql-sql
Joost Kraaijeveld <J.Kraaijeveld@Askesis.nl> writes:
> I am afraid that the problem is more complex. The original database
> (which is created with SQL_ASCII) contains invalid byte sequences in
> some columns (target database created with UNICODE):

There is no magic bullet to make bad data better.  If the original data
is all in a specific encoding that happens not to be unicode, then you
can get Postgres to translate it for you --- just edit the dump file and
change CLIENT_ENCODING to the real original encoding before reloading.
If, as seems more likely, there's a mishmash of different encodings then
you are in for some pain.  At the minimum you'll have to separate out
the rows that are in each encoding so you can pass them through
different conversion processes.

            regards, tom lane

pgsql-sql by date:

Previous
From: Kenneth Gonsalves
Date:
Subject: Re: psql commandline
Next
From: Joost Kraaijeveld
Date:
Subject: Re: [GENERAL] How do I copy part of table from db1 to db2