X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 0B7CAD7BFC; Wed, 31 Aug 2005 09:47:44 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 31159-09; Wed, 31 Aug 2005 12:47:41 +0000 (GMT) Received: from service-web.de (p15093784.pureserver.info [217.160.106.224]) by svr1.postgresql.org (Postfix) with ESMTP id C659CD6F63; Wed, 31 Aug 2005 09:47:40 -0300 (ADT) Received: from [193.97.247.16] (074-016-066-080.eggenet.de [80.66.16.74]) by service-web.de (Postfix) with ESMTP id E7463200039; Wed, 31 Aug 2005 14:47:42 +0200 (CEST) Message-ID: <4315A6D6.7000806@wildenhain.de> Date: Wed, 31 Aug 2005 14:47:18 +0200 From: Tino Wildenhain User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050802) X-Accept-Language: de-DE, de, en-us, en MIME-Version: 1.0 To: Joost Kraaijeveld Cc: Roman Neuhauser , "Pgsql-sql@postgresql.org" , Pgsql-General Subject: Re: How do I copy part of table from db1 to db2 (and References: <1125482430.9456.6.camel@Panoramix> <20050831104011.GB74859@isis.sigpipe.cz> <1125489603.9456.24.camel@Panoramix> In-Reply-To: <1125489603.9456.24.camel@Panoramix> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.074 required=5 tests=[AWL=0.024, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200508/1571 X-Sequence-Number: 82979 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@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.