Fall back to alternative tsearch dictionary directory

From: Martin Pitt <martin(at)piware(dot)de>
To: PostgreSQL Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Fall back to alternative tsearch dictionary directory
Date: 2008-12-01 15:22:26
Message-ID: 20081201152226.GB8620@piware.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hello all,

as recently mentioned on pg-general@, I am currently working on making
installed myspell/unspell dictionary packages (which install
themselves in /usr/share/myspell/dicts, mostly LATIN encoded)
available to PostgreSQL's tsearch/word stemming in Debian/Ubuntu.

So far I wrote the postgresql-common infrastructure to mangle these
dictionary/affix files to become palatable for PostgreSQL (recoding to
UTF-8, renaming to lowercase, changing file suffix) and install them
into /var/cache/postgresql/dicts/ whenever a {hun,my}spell-* package
is installed or updated.

The remaining bit is teaching postgresql to actually look into
/var/cache/postgresql/dicts/ if it does not find a matching
dictionary/affix file in ${sharepath}/tsearch_data/.

The reasons why I'm not using ${sharepath}/tsearch_data/ in the first
place are that

- it's autogenerated data, as opposed to files statically shipped in
a package

- I do not want to conflict to/overwrite files which the admin
manually put there.

I created an initial demo patch which provides this fallback. It works
great, it passes my test cases (which set up tsearch full text search
and stemming handling) and is pretty simple, too.

However, the path is hardcoded so far, which is of course bad for
upstream inclusion. So this should either become a ./configure option
--with-tsearch-dict-fallback=path (or similar), or even a new optional
configuration parameter for postgresql.conf.

However, before I work on that, I'd like to collect some opinions
about the general idea, and whether you prefer autoconf option or
postgresql.conf, or whether you wouldn't accept it at all?

Thanks a lot in advance!

Martin

--
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)

Attachment Content-Type Size
15-dict-fallback-dir.patch text/x-diff 1.2 KB

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message smithat 2008-12-01 21:33:47 installation bug-cannot create user name
Previous Message Alvaro Herrera 2008-12-01 13:20:56 Re: BUG #4554: download crashes