Re: Preliminary patch for tsearch example dictionaries/parsers in contrib - Mailing list pgsql-patches

From karpov@sao.ru (Sergey V. Karpov)
Subject Re: Preliminary patch for tsearch example dictionaries/parsers in contrib
Date
Msg-id 878x6aakug.fsf@tigris.sai.msu.ru
Whole thread Raw
In response to Re: Preliminary patch for tsearch example dictionaries/parsers in contrib  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Preliminary patch for tsearch example dictionaries/parsers in contrib  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
Tom Lane <tgl@sss.pgh.pa.us> writes:

> Oleg Bartunov <oleg@sai.msu.su> writes:
>> On Tue, 9 Oct 2007, Andrew Dunstan wrote:
>>> Are we in beta or not? To me, beta means nothing but bug fixes go in,
>>> period. No ifs, no buts, no maybes, no exceptions. And that should
>>> definitely go for contrib as well. We need a bit of self-discipline around
>>> here.
>
>> the original intention was to have text search companion with code examples
>> for dictionaries and parser API and ability to keep them in workable
>> condition, instead of having them in SGML documentation.
>
> Yes.  I think that we can justify new contrib code here as a documentation
> bug fix: right now, the examples in sections 12.9 and 12.10 are wrong
> (obsolete), impossible to maintain (which is why they're obsolete;
> they failed to track code changes), and not in a format that's directly
> useful as a template for new code.
>
> However, the dict_regex code is not ready for a number of reasons,
> quite aside from the question of whether we want to add a dependency.
> I concur with the idea of dropping it for now.
>
> I'm a bit inclined to drop dict_roman as well, as it seems of
> questionable real use, and code-example-wise it adds nothing over
> dict_intdict.  That would leave us with two dictionary examples and one
> parser example, and I think both of the dictionaries look useful enough
> to be worth keeping.  (In particular I'd not vote for having only
> dict_intdict since it does not illustrate how to use a config file
> ... and we surely don't want to encourage people to not do that
> correctly.)

I've prepared reduced and renamed version of the examples. It may be
downloaded at

http://lynx.sao.ru/~karpov/tmp/ts_examples.tar.gz

Changes:

 - renamed to ts_examples to better reflect its purpose

 - dict_regex and dict_roman excluded, README corrected correspondingly

 - dict_xsyn now uses the same code to locate its config as built-in
   dictionaries, and can't access files outside
   $(prefix)/share/tsearch_data/. Example config file (which is also
   used in regression test) is installed to this
   folder. README.dict_xsyn mentions it.

 - source reformatted to better match PostgreSQL coding style

It still has a complicated source tree with subfolders for each
example. Have I to break it into three separate contrib modules? Or
combine into one with three build targets (this will break MSVC build)?

Sincerely your,

Sergey Karpov

pgsql-patches by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Preliminary GSSAPI Patches
Next
From: Tom Lane
Date:
Subject: Re: Preliminary patch for tsearch example dictionaries/parsers in contrib