agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Raymond O'Donnell <rod@iol.ie>
To: Suresh Raja <suresh.rajaabc@gmail.com>
To: pgsql-general@postgresql.org
To: pgsql-sql@postgresql.org
Subject: Re: check data for datatype
Date: Fri, 27 Mar 2015 18:14:50 +0000
Message-ID: <55159E1A.3050608@iol.ie> (raw)
In-Reply-To: <CAJP7dtA8eerfd0KvAvNBd3806BQ6uwr2jYEcwgAbXJM_bDs5AQ@mail.gmail.com>
References: <CAJP7dtA8eerfd0KvAvNBd3806BQ6uwr2jYEcwgAbXJM_bDs5AQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-general>

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


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



view thread (5+ messages)  latest in thread

Message-ID: <55159E1A.3050608@iol.ie>
Permalink:  ../55159E1A.3050608@iol.ie/
Also on:    postgresql.org/message-id/55159E1A.3050608@iol.ie

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: rod@iol.ie, suresh.rajaabc@gmail.com, pgsql-general@postgresql.org
  Subject: Re: check data for datatype
  In-Reply-To: <55159E1A.3050608@iol.ie>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox