Re: invalid byte sequence for encoding error

Поиск
Список
Период
Сортировка
От Oliver A. Rojo
Тема Re: invalid byte sequence for encoding error
Дата
Msg-id 446DA4E0.1050407@anticogroup.com
обсуждение исходный текст
Ответ на invalid byte sequence for encoding error  ("Oliver A. Rojo" <oliverrojo@anticogroup.com>)
Список pgsql-general
Markus Wollny wrote:

>Nis Jorgensen wrote:
>
>
>>Oliver A. Rojo wrote:
>>
>>
>>>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>
>>
>>
>
>I had the exact same problem with my upgrade - and a lot more than just
>a couple of occurences. The solution is quite easy however, so if you're
>prepared to simply eliminate the offending bytes, you'll find that iconv
>will be a very fast solution. However at least on my systems (Debian
>Sarge) iconv didn't like my >5GB sized dump files. So in order to
>successfully reimport the dumps, I had to "split --line-bytese0m" the
>SQL-file, pass the parts through iconv -c -f UTF8 -t UTF8 and
>concatenate them back into one file again. There were no more errors on
>feeding the dump back into psql and I didn't come across any missing
>data during my tests, so this has definitely done the trick for me.
>
>You should be aware that this will simply omit the illegal byte
>sequences from the dump. So if you've got some string
>"foo[non-UTF-8-bytes]bar", it will be converted to a simple "foobar" in
>the result. So if you really need to keep things 100% accurate, you'll
>have to actually identify each of these byte-sequences, then find the
>corresponding UTF-8 representation and use some search&replace-scripting
>on the dump before reloading it.
>
>Kind regards
>
>   Markus
>
>
>
>
ahh! the real problem is this: It usually says "invalid byte sequence
for encoding" error when it encounters Ñ character. What should I
supposed to do here?

--


Oliver A. Rojo




______________________________________________________________

This email and any files transmitted with it are confidential
and intended solely for the use of the individual or entity to
whom they are addressed. If you have received this email in error
please notify the system manager. Please note that any views or
opinions presented in this email are solely those of the author
and do not necessarily represent those of the company. Finally,
the recipient should check this email and any attachments for the
 presence of viruses. The company accepts no liability for any
damage caused by any virus transmitted by this email.


В списке pgsql-general по дате отправления:

Предыдущее
От: "Qingqing Zhou"
Дата:
Сообщение: Re: Insert into partition table hangs
Следующее
От: Csaba Nagy
Дата:
Сообщение: allow LIMIT in UPDATE and DELETE