Skip site navigation (1) Skip section navigation (2)

PostgreSQL 6.4.2 locale regexp and like problem

From: Petr Hubeny <psh(at)capitol(dot)cz>
To: pgsql-general(at)postgresql(dot)org
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: PostgreSQL 6.4.2 locale regexp and like problem
Date: 1999-02-04 09:43:03
Message-ID: 19990204104303.C1555@capitol.cz (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-general
Hi,

I've recently found an interesting problem with using czech locale
and the regular expressions matching beginning of the line. I traced
the problem and found it is caused by the optimalization within 
function makeIndexable, especially in the way the string match_most is
constructed. What happens? The expression

text ~ '^regexp'

is rewritten into

( text ~ '^regexp' ) AND ( text >= 'regexp' ) AND ( text >= 'regexp\377' )

( N.B.: The same applies for expression "text LIKE 'match%'". )

HOWEVER, in czech locale is 'regexp\377' < 'regexp' ! So the expression
is doomed to be false.

So I'd like to ask you: Is there any general (read: locale independent)
way to create a 'match_most' string that would allow for such optimalization?

Thanks for your patience,

Psh

-- 

Mgr. Petr Hubený				ICQ UIN: 12472987


Responses

pgsql-bugs by date

Next:From: Petr HubenyDate: 1999-02-04 10:30:54
Subject: Re: [BUGS] PostgreSQL 6.4.2 locale regexp and like problem
Previous:From: Tatsuo IshiiDate: 1999-02-04 00:57:49
Subject: Re: [BUGS] General Bug Report: regexp beginning of line doesn't work properly

pgsql-general by date

Next:From: Petr HubenyDate: 1999-02-04 10:30:54
Subject: Re: [BUGS] PostgreSQL 6.4.2 locale regexp and like problem
Previous:From: Bob DusekDate: 1999-02-04 02:59:22
Subject: Date + Days = Date

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group