Re: utf8 errors - Mailing list pgsql-general

From Pavel Stehule
Subject Re: utf8 errors
Date
Msg-id CAFj8pRAvBs4qjfMqyqMJkX19rm84fMPtfZpp9S8JJA9C+oQ7HQ@mail.gmail.com
Whole thread Raw
In response to Re: utf8 errors  (Jiří Pavlovský <jiri@pavlovsky.eu>)
List pgsql-general
2013/6/25 Jiří Pavlovský <jiri@pavlovsky.eu>:
> On 25.6.2013 21:39, Pavel Stehule wrote:
>> Hello
>>
>> in this mailing list is not high traffic,
>>
>> please try to ask on postgresql general mailing list
>>
>> http://www.postgresql.org/list/pgsql-general/
>>
>> or
>>
>> Czech google groups https://groups.google.com/forum/?hl=cs#!forum/postgresql-cz
>>
>> 2013/6/25 Jiří Pavlovský <jiri@pavlovsky.eu>:
>>> Hello,
>>>
>>> I have a win32 application. It uses gtk for GUI and postgres. Recently I
>>> upgraded to newer gtk and postgres 9.2. I'm now getting utf8 errors from
>>> postgres.
>>> The thing I don't understand that the queries, which postgres complains
>>> about, seem to be perfectly valid.
>>>
>>> For example
>>>  LOG:  statement: INSERT INTO recipients (DealID,
>>> Contactid)                               VALUES (29009, 9387)
>>>  ERROR:  invalid byte sequence for encoding "UTF8": 0x9c
>>>
>> This message is strange - I expect so *ID columns are numeric. Can you
>> show a table definition?
>
> Yes, sure:
>
> CREATE TABLE recipients
> (
>   contactid integer,
>   dealid integer,
>   CONSTRAINT "$1" FOREIGN KEY (contactid)
>       REFERENCES contacts (contactid) MATCH SIMPLE
>       ON UPDATE CASCADE ON DELETE CASCADE,
>   CONSTRAINT recipients_dealid_fk FOREIGN KEY (dealid)
>       REFERENCES subscription (dealid) MATCH SIMPLE
>       ON UPDATE CASCADE ON DELETE CASCADE,
>   CONSTRAINT recipients_dealid_key UNIQUE (dealid, contactid)
> )
>

There is some wrong - pg can raise this message when detect some error
in conversion between client encoding and server encoding. But you
speaking so your client encoding and database encoding is same, and
this situation should not be possible. So you should to recheck your
client encoding and real input.

In old versions Postgres don't check UTF well, so it was possible to
store some strange chars, but it is not possible now.

Pavel Stehule

> --
> Jiří Pavlovský
>


pgsql-general by date:

Previous
From: Jiří Pavlovský
Date:
Subject: Re: utf8 errors
Next
From: James Sewell
Date:
Subject: LDAP referrals