little correction

Lists: pgsql-hackers
From: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
To: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: bruce(at)momjian(dot)us
Subject: little correction
Date: 2007-12-12 11:02:42
Message-ID: Pine.LNX.4.64.0712121359480.13244@sn.sai.msu.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Bruce,

in
http://www.postgresql.org/docs/8.3/static/textsearch-dictionaries.html#TEXTSEARCH-THESAURUS
I think
ALTER TEXT SEARCH CONFIGURATION russian
ADD MAPPING FOR asciiword, asciihword, hword_asciipart WITH thesaurus_simple;

should be
ALTER TEXT SEARCH CONFIGURATION russian
ALTER MAPPING FOR asciiword, asciihword, hword_asciipart WITH thesaurus_simple;

since configuration russian already exists.

Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru),
Sternberg Astronomical Institute, Moscow University, Russia
Internet: oleg(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
phone: +007(495)939-16-83, +007(495)939-23-83


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>, bruce(at)momjian(dot)us
Subject: Re: little correction
Date: 2007-12-13 06:36:33
Message-ID: 4027.1197527793@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Oleg Bartunov <oleg(at)sai(dot)msu(dot)su> writes:
> in
> http://www.postgresql.org/docs/8.3/static/textsearch-dictionaries.html#TEXTSEARCH-THESAURUS
> I think
> ALTER TEXT SEARCH CONFIGURATION russian
> ADD MAPPING FOR asciiword, asciihword, hword_asciipart WITH thesaurus_simple;
> should be
> ALTER TEXT SEARCH CONFIGURATION russian
> ALTER MAPPING FOR asciiword, asciihword, hword_asciipart WITH thesaurus_simple;
> since configuration russian already exists.

Done. I notice that if you try to do it the other way, you get:

regression=# ALTER TEXT SEARCH CONFIGURATION russian
ADD MAPPING FOR asciiword, asciihword, hword_asciipart WITH simple;
ERROR: duplicate key value violates unique constraint "pg_ts_config_map_index"

This is not very good --- we usually try to provide a more friendly
error message than "unique constraint violation" for duplicate system
catalog entries. Not sure how hard it is to fix.

regards, tom lane