Re: is there a function which elminates spaces? - Mailing list pgsql-general

From Jeffrey Melloy
Subject Re: is there a function which elminates spaces?
Date
Msg-id 435D4919.5060006@visualdistortion.org
Whole thread Raw
In response to Re: is there a function which elminates spaces?  ("codeWarrior" <gpatnude@hotmail.com>)
Responses Re: is there a function which elminates spaces?  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
codeWarrior wrote:

>SELECT trim(trailing ' ' from city_name) AS city_name FROM sys_cities;
>
>You might consider reading the manual as there are a multitude of string
>manipulation functions built into postgreSQL....
>
>
You didn't answer his question.  If you're going to rag on someone for
not reading the manual, at least you could read what he's asking.

>"Pierre Couderc" <pierre@couderc.ccNOSPAM> wrote in message
>news:djidc4$2hgk$1@biggoron.nerim.net...
>
>
>>In a WHERE clause, I want to to compare strings ignoring the spaces inside
>>them. Is therd a function to do that? I do not find it in the
>>documentation.
>>
>>SELECT ... WHERE (ignore_spaces(table.phone_number) ~* igore_spaces(?));
>>
>>would be fine but ignore_space() does not exist!
>>Maybe there is a solution based on regular epxression, but I do not see
>>it.
>>
>>
I don't see a way to do it through regular expressions, either, though
in the phone number case, you could split the phone number into
different columns based on area code, whatever the middle group is
called, and whatever the last group is called.  Or you could remove the
spaces before inserting and comparing, or write a function with pl/perl
or something.  With perl's greater regular expression control, it would
probably be a one liner.

Jeff

pgsql-general by date:

Previous
From: Johan Wehtje
Date:
Subject: Re: Why is this function wrong
Next
From: talenat
Date:
Subject: Re: Collate problem