Re: tsearch filenames unlikes special symbols and numbers

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: tsearch filenames unlikes special symbols and numbers
Date: 2007-09-02 22:46:11
Message-ID: 18259.1188773171@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-hackers

Oleg Bartunov <oleg(at)sai(dot)msu(dot)su> writes:
> postgres=# CREATE TEXT SEARCH DICTIONARY ru_ispell (
> TEMPLATE = ispell,
> DictFile = 'russian-utf8.dict',
> AffFile = 'russian-utf8.aff',
> StopWords = russian
> );
> ERROR: invalid text search configuration file name "russian-utf8.dict"

I made it reject all but latin letters, which is the same restriction
that's in place for timezone set filenames. That might be overly
strong, but we definitely have to forbid "." and "/" (and "\" on
Windows). Do we want to restrict it to letters, digits, underscore?
Or does it need to be weaker than that?

> Also, I'm wondering do we really need to show all schemas without
> text search configurations defined ? Looks rather stranger.

Um ... I don't see that; I get

regression=# \dF
List of text search configurations
Schema | Name | Description
------------+------------+---------------------------------------
pg_catalog | danish | Configuration for danish language
pg_catalog | dutch | Configuration for dutch language
pg_catalog | english | Configuration for english language
pg_catalog | finnish | Configuration for finnish language
pg_catalog | french | Configuration for french language
pg_catalog | german | Configuration for german language
pg_catalog | hungarian | Configuration for hungarian language
pg_catalog | italian | Configuration for italian language
pg_catalog | norwegian | Configuration for norwegian language
pg_catalog | portuguese | Configuration for portuguese language
pg_catalog | romanian | Configuration for romanian language
pg_catalog | russian | Configuration for russian language
pg_catalog | simple | simple configuration
pg_catalog | spanish | Configuration for spanish language
pg_catalog | swedish | Configuration for swedish language
pg_catalog | turkish | Configuration for turkish language
(16 rows)

Are you sure you're using CVS-head psql?

> Another problem I see are broken examples of dictionary and parser in
> documentation:
> http://momjian.us/main/writings/pgsql/sgml/textsearch-rule-dictionary-example.html
> http://momjian.us/main/writings/pgsql/sgml/textsearch-parser-example.html

Yeah, I wanted to discuss that with you. Code examples in sgml docs are
a bad idea: they're impossible to use as actual templates, because of
all the weird markup changes, and there's no easy way to notice if
they're broken. It would be better to remove these from the docs and
set them up as contrib modules.

regards, tom lane

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Gregory Stark 2007-09-02 23:26:46 Re: tsearch filenames unlikes special symbols and numbers
Previous Message Oleg Bartunov 2007-09-02 21:35:55 Re: tsearch filenames unlikes special symbols and numbers

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2007-09-02 22:49:57 Re: Re: [COMMITTERS] pgsql: Fix brain fade in DefineIndex(): it was continuing to access the
Previous Message Oleg Bartunov 2007-09-02 21:35:55 Re: tsearch filenames unlikes special symbols and numbers