Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 760F42E0261 for ; Sun, 30 Dec 2007 21:40:16 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 83478-07 for ; Sun, 30 Dec 2007 21:40:06 -0400 (AST) Received: from weatherbeeta.com.au (unknown [218.214.212.154]) by postgresql.org (Postfix) with ESMTP id 91FB62E0260 for ; Sun, 30 Dec 2007 21:40:10 -0400 (AST) Received: (qmail 31452 invoked from network); 31 Dec 2007 01:40:08 -0000 X-NetworkBox-HamSign: 0101;OUT;wbeetaau1;2980c01aa1ac800da0b9315dce148435; Received: from mail.weatherbeeta.com.au (10.20.0.2) by network-box.weatherbeeta.com.au with SMTP; 31 Dec 2007 01:40:08 -0000 Received: (qmail 30093 invoked by uid 1166); 31 Dec 2007 12:40:07 +1100 Received: from 172.20.0.155 by mail.weatherbeeta.com.au (envelope-from , uid 1165) with qmail-scanner-1.25-st-qms (clamdscan: 0.88.6/2315. perlscan: 1.25-st-qms. Clear:RC:1(172.20.0.155):. Processed in 0.287662 secs); 31 Dec 2007 01:40:07 -0000 X-Antivirus-mail.weatherbeeta.com.au-Mail-From: phillip.smith@weatherbeeta.com.au via mail.weatherbeeta.com.au X-Antivirus-mail.weatherbeeta.com.au: 1.25-st-qms (Clear:RC:1(172.20.0.155):. Processed in 0.287662 secs Process 30082) Received: from it-phil.weatherbeeta.com.au (HELO wbaus090) (172.20.0.155) by mail.weatherbeeta.com.au with SMTP; 31 Dec 2007 12:40:05 +1100 From: "Phillip Smith" To: "'Joshua D. Drake'" Cc: "'Tom Lane'" , Subject: Re: Restoring pg_dump Backup with psql Fails Date: Mon, 31 Dec 2007 12:40:12 +1100 Organization: Weatherbeeta Pty Ptd Message-ID: <007401c84b4e$15be6270$9b0014ac@wbaus090> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6626 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 In-Reply-To: <4775D2F2.4080502@commandprompt.com> X-Scanned-By-wbeetaau1: Virus scan performed by network-box X-Scanned-By-wbeetaau1: Scanner file id is wbeetaau1-1199065208.209-31445-000 X-Scanned-By-wbeetaau1: No known viruses found in message (received+scanned in 0.01/0.03 secs) X-Scanned-By-wbeetaau1: Spam-Check-Result: No, hits=0 required=7 tests= autolearn=no version=2.0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.146 tagged_above=0 required=5 tests=AWL=-0.240, BAYES_05=-1.11, MIME_QP_LONG_LINE=1.396, RDNS_NONE=0.1 X-Spam-Level: X-Archive-Number: 200712/250 X-Sequence-Number: 27767 > You have several problems in this dump. One it appears that some of = the > releations already exist. Did you by chance accidently create stuff > within template1 at some point? I think I've found my problem: [postgres@stirling backups]$ psql template1 Welcome to psql 8.2.4, the PostgreSQL interactive terminal. template1=3D# \d List of relations Schema | Name | Type | Owner --------+--------------+-------+---------- public | buyers | table | postgres public | creditors | table | postgres public | debtors | table | postgres public | grps | table | postgres public | po | table | postgres public | sales_orders | table | postgres public | stkmvt | table | postgres public | stock | table | postgres public | sys | table | postgres (9 rows) template1=3D# I don't know how or when those tables were created in template1 - = they're certainly not supposed to be there or needed. Is it safe to just DROP = the tables from template1? > Secondly you need to look into iconv to fix your invalid UTF8 data. My bad - the old database was using SQL_ASCII encoding, but when I = recreated it I let it default to UTF8. Re-created it again with SQL_ASCII encoding, which didn't copy the = tables from template1 and now the restore seems to be going OK :) THINK BEFORE YOU PRINT - Save paper if you don't really need to print this *******************Confidentiality and Privilege Notice******************* The material contained in this message is privileged and confidential to the addressee. If you are not the addressee indicated in this message or responsible for delivery of the message to such person, you may not copy or deliver this message to anyone, and you should destroy it and kindly notify the sender by reply email. Information in this message that does not relate to the official business of Weatherbeeta must be treated as neither given nor endorsed by Weatherbeeta. Weatherbeeta, its employees, contractors or associates shall not be liable for direct, indirect or consequential loss arising from transmission of this message or any attachments e-mail.