pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Phillip Smith <phillip.smith@weatherbeeta.com.au>
Cc: pgsql-admin@postgresql.org
Subject: Re: Restoring pg_dump Backup with psql Fails
Date: Sat, 29 Dec 2007 00:09:01 -0500
Message-ID: <28728.1198904941@sss.pgh.pa.us> (raw)
In-Reply-To: <004b01c849cd$badabd80$9b0014ac@wbaus090>
References: <004b01c849cd$badabd80$9b0014ac@wbaus090>

"Phillip Smith" <phillip.smith@weatherbeeta.com.au> writes:
> I've attached the first 512 lines of the output from psql. The whole output
> is 3mb.

Hmm, these are a bit troubling:

> ERROR:  relation "grps" already exists
> ...
> ERROR:  relation "stock" already exists

because you claimed you were restoring into an empty database ---
either you're mistaken or there is an interesting bug in pg_dump.
Please look into that more closely.

It's hard to be entirely certain, but the subsequent errors seem to
mostly flow from having pre-existing tables "grps" and "stock" that
don't match what the dump script is expecting.

There seems to be a separate encoding problem too:

> ERROR:  invalid byte sequence for encoding "UTF8": 0x96
> HINT:  This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".
> CONTEXT:  COPY dwh_cust, line 7413
> ERROR:  invalid byte sequence for encoding "UTF8": 0xe86d65
> HINT:  This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".
> CONTEXT:  COPY dwh_stk, line 323461

You didn't mention what PG version you are dumping from, but I'm
thinking it was one that wasn't very strict about encoding correctness.
You may need to clean up the dump file with iconv or some similar tool
--- look through the PG archives for lots of previous discussions about
that.

			regards, tom lane



view thread (8+ messages)  latest in thread

Message-ID: <28728.1198904941@sss.pgh.pa.us>
Permalink:  ../28728.1198904941@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/28728.1198904941@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, phillip.smith@weatherbeeta.com.au
  Subject: Re: Restoring pg_dump Backup with psql Fails
  In-Reply-To: <28728.1198904941@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox