Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 8222620AEDF for ; Sun, 5 Feb 2012 09:56:46 -0400 (AST) Received: from mail-qw0-f46.google.com ([209.85.216.46]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Ru2aD-0007yS-Ab for pgsql-sql@postgresql.org; Sun, 05 Feb 2012 13:56:45 +0000 Received: by qadc10 with SMTP id c10so1614730qad.19 for ; Sun, 05 Feb 2012 05:56:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=CZg0diBHSQuJhYA/RAD/vOfGFU4a6zpeHvdSoz/1VbE=; b=Sr1YhNzMpsdNZIB3V71c7skeZc9olvvsxzI1hbDodLW1BVA8F77IXAQrpT32JmkHZZ wrNpAUHsztOC08NwRTIF4OKiKoNasf2AVgBqBsHfCjGUGqP/HMXnn3ulJewsGG6tevHX aIap302awCpmeJle7ClNDlplV9y27OdyAqWfQ= MIME-Version: 1.0 Received: by 10.224.200.6 with SMTP id eu6mr16465083qab.93.1328450191069; Sun, 05 Feb 2012 05:56:31 -0800 (PST) Received: by 10.229.234.14 with HTTP; Sun, 5 Feb 2012 05:56:31 -0800 (PST) In-Reply-To: <4F2E887D.3040108@gmx.net> References: <4F2E887D.3040108@gmx.net> Date: Sun, 5 Feb 2012 14:56:31 +0100 Message-ID: Subject: Re: Is there a way to remove every character but numbers? From: =?UTF-8?Q?Viktor_Bojovi=C4=87?= To: Andreas Cc: "pgsql-sql@postgresql.org" Content-Type: multipart/alternative; boundary=20cf300fb0fdbd907d04b837e9df X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201202/15 X-Sequence-Number: 36308 --20cf300fb0fdbd907d04b837e9df Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Sun, Feb 5, 2012 at 2:47 PM, Andreas 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@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/**mailpref/pgsql-sql > try regexp_replace --=20 --------------------------------------- Viktor Bojovi=C4=87 --------------------------------------- Wherever I go, Murphy goes with me --20cf300fb0fdbd907d04b837e9df Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


try regexp_replace


--
---------------------------------------
Vik= tor Bojovi=C4=87
---------------------------------------
Wherever I g= o, Murphy goes with me
--20cf300fb0fdbd907d04b837e9df--