Re: Dumping/Restoring with constraints?

From: Andrew Sullivan <ajs(at)commandprompt(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Dumping/Restoring with constraints?
Date: 2008-08-27 15:41:10
Message-ID: 20080827154109.GA18946@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

On Wed, Aug 27, 2008 at 11:20:55PM +0800, Phoenix Kiula wrote:

> 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

You have bad data in your database. Apparently, you have an encoding
of UTF-8, but you have data in there that's not UTF-8 data. I'll bet
your other encoding is SQL_ASCII.

> 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?

My bet is that you did initdb on one system with a locale of C and on
another with a locale of utf-8 (somehow). You can use pg_controldata
to find out: run it against the data areas on each system.

If I'm right, then you probably want to run initidb again on the
target system.

A

--
Andrew Sullivan
ajs(at)commandprompt(dot)com
+1 503 667 4564 x104
http://www.commandprompt.com/

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Valentin Bogdanov 2008-08-27 15:42:25 fsync off without a restart
Previous Message Bill Moran 2008-08-27 15:41:08 Re: Dumping/Restoring with constraints?

Browse pgsql-general by date

  From Date Subject
Next Message Phoenix Kiula 2008-08-27 15:54:27 Re: Dumping/Restoring with constraints?
Previous Message Bill Moran 2008-08-27 15:41:08 Re: Dumping/Restoring with constraints?