From: Oleg Bartunov <oleg@sai.msu.su>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Gregory Stark <stark@enterprisedb.com>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: tsearch filenames unlikes special symbols and numbers
Date: Sun, 9 Sep 2007 08:38:37 +0400 (MSD)
Message-ID: <Pine.LNX.4.64.0709090817530.2767@sn.sai.msu.ru> (raw)
In-Reply-To: <19257.1188777110@sss.pgh.pa.us>
References: <162867790709021328i7771aa9jfe79268bccbf123d@mail.gmail.com>
<Pine.LNX.4.64.0709030113090.2767@sn.sai.msu.ru>
<18259.1188773171@sss.pgh.pa.us>
<87y7foir7t.fsf@oxford.xeocode.com>
<19257.1188777110@sss.pgh.pa.us>
On Sun, 2 Sep 2007, Tom Lane wrote:
> Gregory Stark <stark@enterprisedb.com> writes:
>> "Tom Lane" <tgl@sss.pgh.pa.us> writes:
>>> 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?
>
>> What's the problem with "."?
>
> ../../../../etc/passwd
>
> Possibly we could allow '.' as long as we forbade /, but the other
> trouble with allowing . is that it encourages people to try to specify
> the filetype suffix (as indeed Oleg was doing). I'd prefer to keep the
> suffixes out of the SQL object definitions, with an eye to possibly
> someday migrating all the configuration data inside the database.
> There's a reasonable argument for restricting the names used for these
> things in the SQL definitions to be valid SQL identifiers, so that that
> will work nicely...
So, what's the current policy ? Still a-z, A-Z ? I think we should allow
'.' and prevent '/'. Look, how ugly is our current ispell setup, which
depends on 3 files - stop word list, .dict and .aff.
Right now, I can use something like
CREATE TEXT SEARCH DICTIONARY en_ispell (
TEMPLATE = ispell,
DictFile = englishDict,
AffFile = englishAff,
StopWords = english
);
I'd better use english.dict, english.aff, english.stop, whih is usual for
any user, without dictating user here. We already did a lot of
restrictions.
I hope we won't require special extension like .dict, .aff, since it's
unknown in advance what files will use other dictionaries.
If we allow '.' without '/', then we'd be happy.
I'd remove requirement for extension of stop words list, which looks
rather artificially to me.
Oh, my god, I see we dictate extensions !
STATEMENT: CREATE TEXT SEARCH DICTIONARY en_ispell (
TEMPLATE = ispell,
DictFile = englishDict,
AffFile = englishAff,
StopWords = englishStop
);
ERROR: could not open dictionary file "/usr/local/pgsql-dev/share/tsearch_data/englishdict.dict": No such file or directory
Folk, this is too much ! Now, we dictate extensions '.dict, .affix, .stop',
what else ?
Does it defined by ispell template only, or it's global requirements ?
Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru),
Sternberg Astronomical Institute, Moscow University, Russia
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(495)939-16-83, +007(495)939-23-83
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-docs@postgresql.org
Cc: oleg@sai.msu.su, tgl@sss.pgh.pa.us, stark@enterprisedb.com, pavel.stehule@gmail.com, pgsql-hackers@postgresql.org
Subject: Re: tsearch filenames unlikes special symbols and numbers
In-Reply-To: <Pine.LNX.4.64.0709090817530.2767@sn.sai.msu.ru>
References: <162867790709021328i7771aa9jfe79268bccbf123d@mail.gmail.com> <Pine.LNX.4.64.0709030113090.2767@sn.sai.msu.ru> <18259.1188773171@sss.pgh.pa.us> <87y7foir7t.fsf@oxford.xeocode.com> <19257.1188777110@sss.pgh.pa.us> <Pine.LNX.4.64.0709090817530.2767@sn.sai.msu.ru>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox