Re: How do I copy part of table from db1 to db2 (and

From: Tino Wildenhain <tino(at)wildenhain(dot)de>
To: Joost Kraaijeveld <J(dot)Kraaijeveld(at)Askesis(dot)nl>
Cc: Roman Neuhauser <neuhauser(at)sigpipe(dot)cz>, "Pgsql-sql(at)postgresql(dot)org" <Pgsql-sql(at)postgresql(dot)org>, Pgsql-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: How do I copy part of table from db1 to db2 (and
Date: 2005-08-31 12:47:18
Message-ID: 4315A6D6.7000806@wildenhain.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

Joost Kraaijeveld schrieb:
> On Wed, 2005-08-31 at 12:40 +0200, Roman Neuhauser wrote:
>
>> check these man pages: pg_dump(1), pg_restore(1), alter_table(7)
>
>
> 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):
>
> jkr(at)Panoramix:~/postgresql$ pg_dump -t artik munttest | psql muntfinal
>
>>output.txt
>
> ERROR: invalid byte sequence for encoding "UNICODE": 0xeb207a
> CONTEXT: COPY artik, line 11705, column omschrijving: "Anna v. Groot
> Brittannië zi prf 38.61 mm"
>
> So I cannot dump/restore/alter table. I was hoping that piping the text
> from stdout to psql that a valid conversion to unicode would take place
> but apparently that is not the case.
>
> Any other ideas?

If you know the implicit charset you used in your SQL_ASCII
db, try with: SET client_encoding TO 'the_charset';
In your import script if you use one.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Doug Bloebaum 2005-08-31 12:58:52 Re: About "ERROR: must be *superuser* to COPY to or from a file"
Previous Message Patrick.FICHE 2005-08-31 12:24:52 Re: detection of VACUUM in progress

Browse pgsql-sql by date

  From Date Subject
Next Message digit-x 2005-08-31 12:54:57 Re: psql commandline
Previous Message Kenneth Gonsalves 2005-08-31 12:43:18 Re: psql commandline