Re: tsearch filenames unlikes special symbols and numbers

From: "Ben Tilly" <btilly(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>, "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, "Gregory Stark" <stark(at)enterprisedb(dot)com>, "Oleg Bartunov" <oleg(at)sai(dot)msu(dot)su>, "PostgreSQL Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: tsearch filenames unlikes special symbols and numbers
Date: 2007-09-04 15:38:28
Message-ID: acc274b30709040838s31410a71x149b2e87f9590db2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-hackers

On 9/4/07, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
[...]
> But on further thought it strikes me that insisting on all lower case
> doesn't eliminate case-sensitivity portability problems. For instance,
> suppose the given parameter is 'foo' and the actual file name is
> Foo.dict. This will work fine on Windows and will stop working when
> moved to Unix. So I'm not sure we really buy much by rejecting
> upper-case letters in the parameter --- all we do is constrain which
> side of the fence you have to fix any mismatches on. And we picked the
> side that only a DBA, rather than a plain SQL user, can fix.

True, only a DBA can fix it. But only a DBA can screw it up. That
seems reasonable to me. Furthermore fixing this mistake at the plain
SQL user level in reality means auditing a code base for the
construct, which is never fun.

However if you wish to be paranoid, I believe that all filesystems of
interest to PostgreSQL are at least case preserving. In which case on
case sensitive filesystems you could check that the case of the stored
filename matches what you want it to be. Now the problem of the
filename having the case wrong can be detected on both Windows and
Unix.

Of course that check is a complication and slows things down. If all
dictionary files have to be in a fixed directory, then you can easily
add a cron job that scans that directory and fixes the case of any
dictionary files that have upper case letters in their names.
(Beware, there was once a bug in Windows where renaming Foo to foo
accidentally deleted the file. It is therefore safer to rename Foo to
bar then bar to foo. However this is a moot point since I doubt that
anyone would actually run a brand new PostgreSQL database on an early
version of NT 4.0...)

Cheers,
Ben

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Tom Lane 2007-09-04 16:19:14 Re: Code examples
Previous Message Pavel Stehule 2007-09-04 15:18:16 Re: tsearch filenames unlikes special symbols and numbers

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Page 2007-09-04 15:46:34 Re: Has anyone tried out the PL/pgSQL debugger?
Previous Message Pavel Stehule 2007-09-04 15:33:31 Re: Has anyone tried out the PL/pgSQL debugger?