Re: Is there a function which eliminates spaces?

From: Michael Glaesemann <grzm(at)myrealbox(dot)com>
To: Pierre Couderc <pierre(at)couderc(dot)cc>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Is there a function which eliminates spaces?
Date: 2005-10-24 13:46:50
Message-ID: F03C87FE-21FA-44B6-B8A0-FAA95B2F1AB5@myrealbox.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


On Oct 24, 2005, at 22:24 , Pierre Couderc wrote:

> SELECT (...) WHERE (ignore_spaces(table.phone_number) ~*
> igore_spaces(?));
>
> would be fine but ignore_space() does not exist!

Take a look at translate() or replace(). They may do what you want.

http://www.postgresql.org/docs/8.0/interactive/functions-string.html

test=# select translate('foo foo', ' ', '') = translate('foo foo
', ' ', '');
?column?
----------
t
(1 row)

Hope this helps.

Michael Glaesemann
grzm myrealbox com

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message operationsengineer1 2005-10-24 15:45:18 Re: WinXP Install - Account Password Information
Previous Message Pierre Couderc 2005-10-24 13:24:48 Is there a function which eliminates spaces?