Empty dictionary file when creating text search dictionary

Started by Robert Gravsjöover 16 years ago2 messageshackers
Jump to latest
#1Robert Gravsjö
robert@blogg.se

Found this a couple of weeks back and just re-tested against head:

CREATE TEXT SEARCH DICTIONARY with an empty thesaurus file will crasch
the backend.

To reproduce:
$ echo "" > $(pg_config --sharedir)/tsearch_data/thesaurus_empty.ths

Then use this thesaurus to create a text search dictionary:
CREATE TEXT SEARCH DICTIONARY thesaurus_astro (
TEMPLATE = thesaurus,
DictFile = thesaurus_empty,
Dictionary = english_stem
);

It doesn't matter if the file is compleatly empty or just have comments.
The result is the same.
Add a word:
$ echo "foo: bar" >> $(pg_config
--sharedir)/tsearch_data/thesaurus_empty.ths

Creating the dictionary will now work.

Sorry I have no patch to attach.

Regards,
roppert

PS. I happend to send this mail from a wrong, non-subscribed, address
earlier so if it turns up duplicated I apologize.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Robert Gravsjö (#1)
Re: Empty dictionary file when creating text search dictionary

=?ISO-8859-1?Q?Robert_Gravsj=F6?= <robert@blogg.se> writes:

Found this a couple of weeks back and just re-tested against head:
CREATE TEXT SEARCH DICTIONARY with an empty thesaurus file will crasch
the backend.

Fixed, thanks for the report!

regards, tom lane