Skip site navigation (1) Skip section navigation (2)

Empty dictionary file when creating text search dictionary

From: Robert Gravsjö <robert(at)blogg(dot)se>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Empty dictionary file when creating text search dictionary
Date: 2009-11-30 15:57:18
Message-ID: 4B13EB5E.2070507@blogg.se (view raw or flat)
Thread:
Lists: 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

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

Responses

pgsql-hackers by date

Next:From: Tim BunceDate: 2009-11-30 16:07:53
Subject: Re: Initial refactoring of plperl.c [PATCH]
Previous:From: Robert GravsjöDate: 2009-11-30 15:31:16
Subject: Empty dictionary file when creating text search dictionary

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group