Re: Restoring pg_dump Backup with psql Fails

From: "Phillip Smith" <phillip(dot)smith(at)weatherbeeta(dot)com(dot)au>
To: "'Joshua D(dot) Drake'" <jd(at)commandprompt(dot)com>
Cc: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Restoring pg_dump Backup with psql Fails
Date: 2007-12-31 01:40:12
Message-ID: 007401c84b4e$15be6270$9b0014ac@wbaus090
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

> 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(at)stirling backups]$ psql template1
Welcome to psql 8.2.4, the PostgreSQL interactive terminal.
template1=# \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=#

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.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2007-12-31 01:59:52 Re: Restoring pg_dump Backup with psql Fails
Previous Message Søren Laursen 2007-12-30 18:09:06 Re: Apache Logging to PostgreSQL