Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 350959FA10F for ; Tue, 4 Sep 2007 12:38:34 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 33364-01 for ; Tue, 4 Sep 2007 12:38:30 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from fk-out-0910.google.com (fk-out-0910.google.com [209.85.128.185]) by postgresql.org (Postfix) with ESMTP id EBE609FA104 for ; Tue, 4 Sep 2007 12:38:29 -0300 (ADT) Received: by fk-out-0910.google.com with SMTP id b27so1825130fka for ; Tue, 04 Sep 2007 08:38:29 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=NRS3gfSY2q/6SYzz+TMRQNDOfCQDK7aKqJSSX31gvs/4E5r7GvOnv145O8shwbrQuXUrF3vPWTqt/1pjBRACdkB6nwDCm/Ct0wxqnrFlbPvFVdO+VuqrZak8C9wLN1c8jyR8f5dfKXxxquKDGkO47N32gQ7WWW3z3JdP8UW/HbI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=NPE6xqdR6K9C5MFV+GfLjp3dJe8Uhzp3H5360feRw4iXXZvgzVhB95wqCjeqEG/MclvDRJMc331JM9DbczmJ6hTFdgPbcwxa0IXyqI9tWqVPE1Tbtsu0ijZUM6VIodBRqtgXscXlOWRNm1HBkv2eJdVxznfDR4+7fp2+v3LFb3s= Received: by 10.82.162.14 with SMTP id k14mr3269768bue.1188920308646; Tue, 04 Sep 2007 08:38:28 -0700 (PDT) Received: by 10.82.118.15 with HTTP; Tue, 4 Sep 2007 08:38:28 -0700 (PDT) Message-ID: Date: Tue, 4 Sep 2007 08:38:28 -0700 From: "Ben Tilly" To: "Tom Lane" Subject: Re: tsearch filenames unlikes special symbols and numbers Cc: "Pavel Stehule" , "Alvaro Herrera" , "Gregory Stark" , "Oleg Bartunov" , "PostgreSQL Hackers" In-Reply-To: <23999.1188913981@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <162867790709021328i7771aa9jfe79268bccbf123d@mail.gmail.com> <18259.1188773171@sss.pgh.pa.us> <87y7foir7t.fsf@oxford.xeocode.com> <19257.1188777110@sss.pgh.pa.us> <20070903190302.GD10282@alvh.no-ip.org> <24214.1188846905@sss.pgh.pa.us> <5404.1188864206@sss.pgh.pa.us> <162867790709032204m1895d36ci78de7d4f4e759655@mail.gmail.com> <23999.1188913981@sss.pgh.pa.us> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/150 X-Sequence-Number: 107302 On 9/4/07, Tom Lane 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