Re: invalid byte sequence for encoding error - Mailing list pgsql-general

From Nis Jorgensen
Subject Re: invalid byte sequence for encoding error
Date
Msg-id 446D912F.1030709@superlativ.dk
Whole thread Raw
In response to Re: invalid byte sequence for encoding error  ("Oliver A. Rojo" <oliverrojo@anticogroup.com>)
List pgsql-general
Oliver A. Rojo wrote:
> Nis Jorgensen wrote:
>
>> Oliver A. Rojo wrote:
>>
>>> Hi!
>>>
>>> I've just recently upgraded my database from 7.4.8 to 8.0.1. Im
>>> dumping data i got from my old db to my new db but eventually an
>>> error occured

>> I fixed it by fixing the original db and dumping again. If this is not
>> desirable you can of course restore to a clean 7.4.8, fix, dump.

> hi!
> how do you fix your original db?
>

Since I had only 3 occurrences of the error, I used hand-crafted update
statements. The fact that the replacement for the invalid characters was
constant and plain ascii made this very easy.

If you have many occurrences of the error, or if you need to do
replacement based on the invalid bytes, things become trickier. You
might even be better of working on the dump file directly using
perl/<favourite scripting language>

/Nis


pgsql-general by date:

Previous
From: "Oliver A. Rojo"
Date:
Subject: Re: invalid byte sequence for encoding error
Next
From: "Qingqing Zhou"
Date:
Subject: Re: Insert into partition table hangs