pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Elphick <olly@lfix.co.uk>
To: Theo Galanakis <Theo.Galanakis@lonelyplanet.com.au>
Cc: pgsql-sql@postgresql.org
Subject: Re: Isnumeric function?
Date: Tue, 07 Sep 2004 07:05:26 +0100
Message-ID: <1094537126.6360.279.camel@linda> (raw)
In-Reply-To: <82E30406384FFB44AFD1012BAB230B55037D056E@shiva.au.lpint.net>
References: <82E30406384FFB44AFD1012BAB230B55037D056E@shiva.au.lpint.net>

On Tue, 2004-09-07 at 06:44, Theo Galanakis wrote:
> How could you determine if a value being inserted into a varchar
> column is numeric?
> 
> I was thinking of using a Regular expression to find this, something
> like
> 
> .. Where content ~* '^[0-9]{1,10}'

 ~ '^[0-9]+$'

Your version only checks the beginning of the string.

> There must be an easier way like a isNumeric() function?

Not that I know of.

-- 
Oliver Elphick                                          olly@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA  92C8 39E7 280E 3631 3F0E  1EC0 5664 7A2F A543 10EA
                 ========================================
     "For whosoever shall call upon the name of the Lord 
      shall be saved."         Romans 10:13 





view thread (29+ messages)  latest in thread

Message-ID: <1094537126.6360.279.camel@linda>
Permalink:  ../1094537126.6360.279.camel@linda/
Also on:    postgresql.org/message-id/1094537126.6360.279.camel@linda

 · 

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: olly@lfix.co.uk, Theo.Galanakis@lonelyplanet.com.au
  Subject: Re: Isnumeric function?
  In-Reply-To: <1094537126.6360.279.camel@linda>

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

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