Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 1AB1264FEDD for ; Wed, 27 Aug 2008 12:21:08 -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 82375-06 for ; Wed, 27 Aug 2008 12:20:57 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by postgresql.org (Postfix) with ESMTP id 774B664FD2D for ; Wed, 27 Aug 2008 12:20:57 -0300 (ADT) Received: by ey-out-2122.google.com with SMTP id 6so462869eyi.61 for ; Wed, 27 Aug 2008 08:20:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=XK82TyQCrm1T6KwTF0kgSLQBZ/r2GLrzM2IVFoAMkzI=; b=YQ+UjjjhvddZEcX/iuzUpMfQTz/IoeigFBdR/+I/u5w5LqdLqAqEbweSp7krZqZlAC ZI7WeBm0cNYUWPRlmm7ze4As6m1TZtqpMExPSQrpn72Puiw05nwwd6qoETPWIxJ1+ty+ aJO4qkDjEOv5lo6rK4EFGamSdtdlGxWuRIlcs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=iUaVwy1CB+6Z7harPBufG8K0ZFNNDi+bH59G9gLZd/zjMlqMzSk9NGH6B5lGrO6w+s Ct9NXKEbiudrvB5jpzlIoUKYYOQhPo7atmyz+UNTZaBdlykqQ6CCf1Olb7ascnqjLw4+ wclnIuGykVuAaPySFmmQL/BfWAvVTR6Kn6a2s= Received: by 10.210.104.20 with SMTP id b20mr97958ebc.30.1219850455341; Wed, 27 Aug 2008 08:20:55 -0700 (PDT) Received: by 10.210.130.1 with HTTP; Wed, 27 Aug 2008 08:20:55 -0700 (PDT) Message-ID: Date: Wed, 27 Aug 2008 23:20:55 +0800 From: "Phoenix Kiula" To: "Tom Lane" Subject: Re: Dumping/Restoring with constraints? Cc: "PG-General Mailing List" In-Reply-To: <23743.1219848802@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <22708.1219845242@sss.pgh.pa.us> <23571.1219848176@sss.pgh.pa.us> <23743.1219848802@sss.pgh.pa.us> 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/957 X-Sequence-Number: 136787 On Wed, Aug 27, 2008 at 10:53 PM, Tom Lane wrote: > > No, you were right the first time: just feed the dump script to psql. > Ok. Tried that. Because there's no database, I have to execute the psql command as "postgres" otherwise it doesn't work. So here's my command: $ psql -d postgres -U postgres -h localhost < mydb.sql 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 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? Thanks