Empty dictionary file when creating text search dictionary - Mailing list pgsql-hackers

From Robert Gravsjö
Subject Empty dictionary file when creating text search dictionary
Date
Msg-id 4B13E544.9080905@blogg.se
Whole thread Raw
Responses Re: Empty dictionary file when creating text search dictionary
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Marko Kreen
Date:
Subject: Re: Application name patch - v4
Next
From: 张中
Date:
Subject: 答复: [HACKERS] is isolation level 'Serializable' in pg not same as 'serializable' in SQL-92?