Skip site navigation (1) Skip section navigation (2)

Re: Restoring pg_dump Backup with psql Fails

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Phillip Smith" <phillip(dot)smith(at)weatherbeeta(dot)com(dot)au>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Restoring pg_dump Backup with psql Fails
Date: 2007-12-29 05:09:01
Message-ID: 28728.1198904941@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-admin
"Phillip Smith" <phillip(dot)smith(at)weatherbeeta(dot)com(dot)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

In response to

pgsql-admin by date

Next:From: LewDate: 2007-12-29 07:21:22
Subject: Re: high-availability on MS Windows cluster -- need insights
Previous:From: Joshua D. DrakeDate: 2007-12-29 04:54:10
Subject: Re: Restoring pg_dump Backup with psql Fails

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group