Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 6735B9F9AAC for ; Sun, 9 Sep 2007 01:38:50 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 02007-03 for ; Sun, 9 Sep 2007 01:38:46 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sn.sai.msu.ru (sn.sai.msu.ru [195.208.220.215]) by postgresql.org (Postfix) with ESMTP id D3E999F9AA8 for ; Sun, 9 Sep 2007 01:38:45 -0300 (ADT) Received: from sn.sai.msu.ru (localhost [127.0.0.1]) by sn.sai.msu.ru (8.12.8/8.12.8) with ESMTP id l894cb7b004157; Sun, 9 Sep 2007 08:38:37 +0400 Received: from localhost (megera@localhost) by sn.sai.msu.ru (8.12.8/8.12.8/Submit) with ESMTP id l894cb75004154; Sun, 9 Sep 2007 08:38:37 +0400 X-Authentication-Warning: sn.sai.msu.ru: megera owned process doing -bs Date: Sun, 9 Sep 2007 08:38:37 +0400 (MSD) From: Oleg Bartunov X-X-Sender: megera@sn.sai.msu.ru To: Tom Lane cc: Gregory Stark , Pavel Stehule , PostgreSQL Hackers Subject: Re: tsearch filenames unlikes special symbols and numbers In-Reply-To: <19257.1188777110@sss.pgh.pa.us> Message-ID: References: <162867790709021328i7771aa9jfe79268bccbf123d@mail.gmail.com> <18259.1188773171@sss.pgh.pa.us> <87y7foir7t.fsf@oxford.xeocode.com> <19257.1188777110@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/376 X-Sequence-Number: 107528 On Sun, 2 Sep 2007, Tom Lane wrote: > Gregory Stark writes: >> "Tom Lane" 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