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 DCF4AD8592 for ; Wed, 31 Aug 2005 11:29:58 -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 57384-05 for ; Wed, 31 Aug 2005 14:29:53 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id D171AD77EB for ; Wed, 31 Aug 2005 11:29:52 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j7VETn0E001678; Wed, 31 Aug 2005 10:29:50 -0400 (EDT) To: Joost Kraaijeveld Cc: Roman Neuhauser , "Pgsql-sql@postgresql.org" , Pgsql-General Subject: Re: [SQL] How do I copy part of table from db1 to db2 (and In-reply-to: <1125489603.9456.24.camel@Panoramix> References: <1125482430.9456.6.camel@Panoramix> <20050831104011.GB74859@isis.sigpipe.cz> <1125489603.9456.24.camel@Panoramix> Comments: In-reply-to Joost Kraaijeveld message dated "Wed, 31 Aug 2005 14:00:03 +0200" Date: Wed, 31 Aug 2005 10:29:49 -0400 Message-ID: <1677.1125498589@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 required=5 tests=[AWL=0.006] X-Spam-Level: X-Archive-Number: 200508/1575 X-Sequence-Number: 82983 Joost Kraaijeveld 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