Skip site navigation (1) Skip section navigation (2)

Re: isnumeric() function?

From: Jeff Eckermann <jeff_eckermann(at)yahoo(dot)com>
To: Yudie <yudie(at)axiontech(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: isnumeric() function?
Date: 2004-04-30 14:11:45
Message-ID: (view raw or whole thread)
Lists: pgsql-sql
--- Yudie <yudie(at)axiontech(dot)com> wrote:
> What is isnumeric function in postgresql? 
> I'm using psql version 7.2.2
> thanks
> Yudie

I don't think that function is included as such.  But
you could do something like:

CREATE FUNCTION isnumeric(text) RETURNS boolean AS '
SELECT $1 ~ ''^[0-9]+$''
' LANGUAGE 'sql';

Note that you would need to create this function for
every parameter datatype that you would intend to use,
or else be prepared to cast your input datatype as

> ---------------------------(end of
> broadcast)---------------------------
> TIP 2: you can get off all lists at once with the
> unregister command
>     (send "unregister YourEmailAddressHere" to

Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs 

In response to


pgsql-sql by date

Next:From: Rajesh Kumar MallahDate: 2004-04-30 14:14:10
Subject: Re: Problem in SQL Trigger
Previous:From: Pallav KalvaDate: 2004-04-30 13:37:25
Subject: Re: Permissions not working

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group