[TYPO3-dam] "LIKE BINARY" in SQL-Queries forces errors on PostgreSQL

Martin Kutschker martin.t.kutschker at n0spam.blackbox.net
Sat Jan 12 22:37:43 CET 2008


Karsten Dambekalns schrieb:
> Hi Michiel.
> 
> Michiel Roos wrote:
>> It seems as if it is needed since paths may be similar in characters 
>> but different in case. This is not possible on mac but it is on Linux 
>> (maybe unix too?), I don't know about *BSD. 
> 
> All Unix variants I know of are case-sensitive in their filesystems, as 
> is the Mac, if you format your disk as case-sensitive (like I did). 
> AFAIK only DOS-based systems ignore case.
> 
>> So we do need the BINARY operator.
>>
>> Clearly the dbal does not 'dig' this operator and makes postgres barf 
>> on  what it does produce.
> 
> Right.
> 
>> I can run this by Karsten, our dbal king, he may be busy with 5.0 though.
> 
> I am. It would be no big deal to make the BINARY operator known to DBAL, 
> but what do we do with it? In this case it is used to do the opposite of 
> ILIKE in PostgreSQL, but what else does it do? And what does it do in 
> other SQL variants? I don't have my "SQL in a nutshell" at hand right 
> now...
> 
> It boils down to "support only what makes sense in DBAL", and then find 
> something to translate it to.

The point is any (?) other RDMBS is by default case sensitive. 
PostgreSQL has the ILIKE for case insensitive comparison and Orcale has 
some session settings (!) for this.

So DBAL could simply remove the BINARY operator. OTOH it should use 
ILIKE rather than LIKE on PostgreSQL (unless BINARY is present).

Perhaps TYPO3 should require the DB to default to case insensitive 
searches. This can be done for Oracle. But how about PostgreSQL or MS SQL?

Masi


More information about the TYPO3-project-dam mailing list