Re: Is there a way to remove every character but numbers?

From: Viktor Bojović <viktor(dot)bojovic(at)gmail(dot)com>
To: Andreas <maps(dot)on(at)gmx(dot)net>
Cc: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Is there a way to remove every character but numbers?
Date: 2012-02-05 13:56:31
Message-ID: CAJu1cLYLWkfQb6J8bRPGipP12FWP8Vxfdj9RHsdGprPBvNmLiQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Sun, Feb 5, 2012 at 2:47 PM, Andreas <maps(dot)on(at)gmx(dot)net> wrote:

> Hi,
>
> I need to clean up a text column so that it just contains numbers or the
> "+" sign if it is the first character of the string.
>
> Well, it is needed to normalise up a phone number column.
> So it'd be great if the "+" could be transformed in "00" in the same step.
>
> --
> Sent via pgsql-sql mailing list (pgsql-sql(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/**mailpref/pgsql-sql<http://www.postgresql.org/mailpref/pgsql-sql>
>

try regexp_replace

--
---------------------------------------
Viktor Bojović
---------------------------------------
Wherever I go, Murphy goes with me

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message zoulx1982 2012-02-06 06:11:12 type cast about int to bit
Previous Message Andreas 2012-02-05 13:47:41 Is there a way to remove every character but numbers?