Re: tsearch2 in postgresql 8.3.1 - invalid byte sequence for encoding "UTF8": 0xc3

From: Richard Huxton <dev(at)archonet(dot)com>
To: patrick <patrick(at)11h11(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: tsearch2 in postgresql 8.3.1 - invalid byte sequence for encoding "UTF8": 0xc3
Date: 2008-03-19 18:48:20
Message-ID: 47E15FF4.1000206@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

patrick wrote:
>> Can you identify which row(s) are causing this problem? If we have the
>> value that's causing this, someone can reproduce it.
>
> i have only 1 row:
> 46; "the product name"; "the description";
>
> i don't see any specials chars or accents.

I think I've reproduced it here, and it's not your data.

> knowing that some of my clients are french, should i use LATIN9 as
> database encoding / client encoding? or maybe it's because of the LOCALE
> (French/Canada)?

> UPDATE product SET search_vector = setweight(to_tsvector(name), 'A') ||
> to_tsvector(description);

It's your script. It's got a character that's not UTF8 and you've told
the system that's what your client_encoding is. I think it's "|".

See if you can reproduce it with: SELECT 'abc'::text || 'def::text;

I got the error by editing the script at a command-prompt. If you use
notepad or some other MS-Windows (TM) based editor it should let you
choose ANSI as the format to save in.

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Volkan YAZICI 2008-03-19 19:13:40 Re: SPI_execute_plan(): how to make a Datum to insert type inet ?
Previous Message Alex Vinogradovs 2008-03-19 18:38:03 SPI_execute_plan(): how to make a Datum to insert type inet ?

Browse pgsql-hackers by date

  From Date Subject
Next Message Dan Searle 2008-03-19 18:57:35 MemoryContextSwitchTo() confusion
Previous Message Simon Riggs 2008-03-19 18:16:44 Re: Final Thoughts for 8.3 on LWLocking and Scalability