Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id C71B464FEDD for ; Wed, 27 Aug 2008 12:41:19 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 06796-02 for ; Wed, 27 Aug 2008 12:41:16 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from lists.commandprompt.com (host-159.commandprompt.net [207.173.203.159]) by postgresql.org (Postfix) with ESMTP id 125B464FD2D for ; Wed, 27 Aug 2008 12:41:15 -0300 (ADT) Received: from commandprompt.com (CPE001b63afe888-CM001adea9c5a6.cpe.net.cable.rogers.com [99.236.211.160]) (authenticated bits=0) by lists.commandprompt.com (8.13.8/8.13.8) with ESMTP id m7RFiGNr006362 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 27 Aug 2008 08:44:19 -0700 Date: Wed, 27 Aug 2008 11:41:10 -0400 From: Andrew Sullivan To: pgsql-general@postgresql.org Subject: Re: Dumping/Restoring with constraints? Message-ID: <20080827154109.GA18946@commandprompt.com> Mail-Followup-To: Andrew Sullivan , pgsql-general@postgresql.org References: <22708.1219845242@sss.pgh.pa.us> <23571.1219848176@sss.pgh.pa.us> <23743.1219848802@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (lists.commandprompt.com [207.173.203.159]); Wed, 27 Aug 2008 08:44:19 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200808/959 X-Sequence-Number: 136789 On Wed, Aug 27, 2008 at 11:20:55PM +0800, Phoenix Kiula wrote: > This seems to be it. This is what I should be executing, except that > it spews out many errors, like: > > ERROR: invalid byte sequence for encoding "UTF8": 0x80 You have bad data in your database. Apparently, you have an encoding of UTF-8, but you have data in there that's not UTF-8 data. I'll bet your other encoding is SQL_ASCII. > This prevents my main table from being copied - Why can't the dump and > the restore just copy the file as-is, including the encoding and such? > What am I not doing right? My bet is that you did initdb on one system with a locale of C and on another with a locale of utf-8 (somehow). You can use pg_controldata to find out: run it against the data areas on each system. If I'm right, then you probably want to run initidb again on the target system. A -- Andrew Sullivan ajs@commandprompt.com +1 503 667 4564 x104 http://www.commandprompt.com/