Unix Technical Forum

problem with tsearch and utf-8 on postgresql 8.1

This is a discussion on problem with tsearch and utf-8 on postgresql 8.1 within the Pgsql General forums, part of the PostgreSQL category; --> I created a database with locale it_IT@UTF-8, and I'm facing a weird problem with tsearch. Let me show it: ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 06:23 PM
Ottavio Campana
 
Posts: n/a
Default problem with tsearch and utf-8 on postgresql 8.1

I created a database with locale it_IT@UTF-8, and I'm facing a weird
problem with tsearch. Let me show it:

tmptest=# SELECT * from pg_ts_cfg;
ts_name | prs_name | locale
-----------------+----------+--------------
default_russian | default | ru_RU.KOI8-R
simple | default |
default | default | it_IT@UTF-8
(3 righe)

tmptest=# SELECT to_tsvector ('ciao mamma');
ERROR: could not find tsearch config by locale
tmptest=# UPDATE pg_ts_cfg set locale = 'it_IT@euro' where ts_name =
'default';
UPDATE 1
tmptest=# SELECT to_tsvector ('ciao mamma');
to_tsvector
--------------------
'ciao':1 'mamma':2
(1 riga)

tmptest=# UPDATE pg_ts_cfg set locale = 'it_IT@UTF-8' where ts_name =
'default';
UPDATE 1
tmptest=# SELECT to_tsvector ('ciao mamma');
to_tsvector
--------------------
'ciao':1 'mamma':2
(1 riga)

tmptest=# \q

So at first tsearch does not work. If I change it to it_IT@euro it works
and if I switch back to it_IT@UTF-8 it then works even with that locale.
I cannot understand the reason why it happens. By disconnecting from the
db and connecting again the problem is still there. Do you have any idea
why it happens?

I don't know if it matters, on the systems I have LANG="it_IT@euro" and
LANGUAGE="it_IT"

Thanks,

Ottavio

PS: Im running a backport of postgresql 8.1 on debian sarge.

--
Non c'e' piu' forza nella normalita', c'e' solo monotonia.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIB3UrsbKx4ZV8clIRAj4WAJ43PmFS+EcwDbLFE+wrHs BIEvpC4QCfXrd1
9jOVWijIFGb3ODfXYJdb5Nw=
=6lGL
-----END PGP SIGNATURE-----

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2008, 06:24 PM
Pavel Stehule
 
Posts: n/a
Default Re: problem with tsearch and utf-8 on postgresql 8.1

Hello

UTF8 is supported from 8.2 version

Regards
Pavel Stehule

On 17/04/2008, Ottavio Campana <ottavio@campana.vi.it> wrote:
> I created a database with locale it_IT@UTF-8, and I'm facing a weird problem
> with tsearch. Let me show it:
>
> tmptest=# SELECT * from pg_ts_cfg;
> ts_name | prs_name | locale
> -----------------+----------+--------------
> default_russian | default | ru_RU.KOI8-R
> simple | default |
> default | default | it_IT@UTF-8
> (3 righe)
>
> tmptest=# SELECT to_tsvector ('ciao mamma');
> ERROR: could not find tsearch config by locale
> tmptest=# UPDATE pg_ts_cfg set locale = 'it_IT@euro' where ts_name =
> 'default';
> UPDATE 1
> tmptest=# SELECT to_tsvector ('ciao mamma');
> to_tsvector
> --------------------
> 'ciao':1 'mamma':2
> (1 riga)
>
> tmptest=# UPDATE pg_ts_cfg set locale = 'it_IT@UTF-8' where ts_name =
> 'default';
> UPDATE 1
> tmptest=# SELECT to_tsvector ('ciao mamma');
> to_tsvector
> --------------------
> 'ciao':1 'mamma':2
> (1 riga)
>
> tmptest=# \q
>
> So at first tsearch does not work. If I change it to it_IT@euro it works
> and if I switch back to it_IT@UTF-8 it then works even with that locale.
> I cannot understand the reason why it happens. By disconnecting from the db
> and connecting again the problem is still there. Do you have any idea why it
> happens?
>
> I don't know if it matters, on the systems I have LANG="it_IT@euro" and
> LANGUAGE="it_IT"
>
> Thanks,
>
> Ottavio
>
> PS: Im running a backport of postgresql 8.1 on debian sarge.
>
> --
> Non c'e' piu' forza nella normalita', c'e' solo monotonia.
>
>
>


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:35 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com