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

Select where (upper(xy)~'.CH'); ..matches also SPACE CH

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Select where (upper(xy)~'.CH'); ..matches also SPACE CH
Date: 2000-10-26 04:29:49
Message-ID: 200010260429.e9Q4Tn109649@hub.org (view raw or flat)
Thread:
Lists: pgsql-bugs
Marcel (marcel(at)simmcomm(dot)ch) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
Select where (upper(xy)~'.CH'); ..matches also SPACE CH

Long Description
There exists a problem with the ~ statement. The codesample and the text is from an adult contact database.

The compare string .CH matches the word 'EINEN CHANCE' in the sentence. Seems to be, that the . will match the space between the words. This doesn't happen, if you replace .CH with _CH or something else.

Sample Code
meetingpoint=> select upper(adtext) from ads where adnumber='40ac066e1db0633a' and (upper(adtext)~'.CH');
upper

--------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------
WELCHE DOMINA WILL SICH EINEN SKLAVEN HALTEN. BIN EIN 29-JHRIGER]BI-BOY UND SEHR DEVOT. BITTE GEB
EN SIE MIR EINEN CHANCE DAMIT ICH IHNEN]BEWEISEN KANN DASS ICH IHR SKLAVE SEIN WERDE UND NUR FR S
IE BEREIT BIN]ALLES ZU MACHEN WAS SIE VON MIR VERLANGEN.]UNTERTNIGST IHR SKLAVE]
(1 row)

meetingpoint=> select upper(adtext) from ads where adnumber='40ac066e1db0633a' and (upper(adtext)~'_CH');

upper
-----
(0 rows)

meetingpoint=>

No file was uploaded with this report


Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2000-10-26 04:43:23
Subject: Re: pg_log
Previous:From: The Hermit HackerDate: 2000-10-26 04:11:44
Subject: Re: pg_log

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