Re: [GENERAL] check data for datatype - Mailing list pgsql-sql

From Raymond O'Donnell
Subject Re: [GENERAL] check data for datatype
Date
Msg-id 55159E1A.3050608@iol.ie
Whole thread Raw
In response to check data for datatype  (Suresh Raja <suresh.rajaabc@gmail.com>)
List pgsql-sql
On 27/03/2015 18:08, Suresh Raja wrote:
>     Hi All:
>
>
> I have a very large table and the column type is text.  I would like to
> convert in numeric.  How can I find rows that dont have numbers.  I
> would like to delete those rows.

Use a regular expression:

  select <whatever> from <the table> where <the column> ~ <regexp>

http://www.postgresql.org/docs/9.4/static/functions-matching.html#FUNCTIONS-POSIX-REGEXP

HTH,

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie


pgsql-sql by date:

Previous
From: Suresh Raja
Date:
Subject: check data for datatype
Next
From: Jerry Sievers
Date:
Subject: Re: [GENERAL] check data for datatype