Re: Query failed: ERROR: character with byte sequence 0xc2 0x96 in encoding "UTF8" has no equivalent in encoding "WIN1250" - Mailing list pgsql-general

From Albe Laurenz
Subject Re: Query failed: ERROR: character with byte sequence 0xc2 0x96 in encoding "UTF8" has no equivalent in encoding "WIN1250"
Date
Msg-id A737B7A37273E048B164557ADEF4A58B50FEB496@ntex2010i.host.magwien.gv.at
Whole thread Raw
In response to RE: [GENERAL] Query failed: ERROR: character with byte sequence 0xc2 0x96 in encoding "UTF8" has no equivalent in encoding "WIN1250"  (NTPT <NTPT@seznam.cz>)
Responses Re: Query failed: ERROR: character with byte sequence 0xc2 0x96 in encoding "UTF8" has no equivalent in encoding "WIN1250"
List pgsql-general
I realize I was too short, sorry.

NTPT wrote:
> but how to update affected columns ? error message does not  provide single  clue ( at least row name)

For every table and every column in the source database that might be
affected, try something like:

SELECT id, col FROM tab WHERE col LIKE E'%\x96%';

Then issue UPDATE statements for the affected rows, e.g. replacing "–" with "-".

> And dump-restore ?  It  do not underestand how it could help.. dumped as unicode  restore as unicode =
> I am at the same point ... dumping as latin2 and restore to utf8 will end with the some errors..  I
> suspect

You can run something like this over the plain text dump:

sed -e 's/–/-/g' dump.sql >fixed.sql

Of course there might be other windows characters lurking ...

Yours,
Laurenz Albe

pgsql-general by date:

Previous
From: George Neuner
Date:
Subject: Re: using a postgres table as a multi-writer multi-updater queue
Next
From: Albe Laurenz
Date:
Subject: Re: Query failed: ERROR: character with byte sequence 0xc2 0x96 in encoding "UTF8" has no equivalent in encoding "WIN1250"