Re: isnumeric() function?

From: "Yudie" <yudie(at)axiontech(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: isnumeric() function?
Date: 2004-04-30 15:29:16
Message-ID: 003601c42ec7$e7806ee0$8401a8c0@home.axiontech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Great the function works, but what does it means?
SELECT $1 ~ ''^[0-9]+$''

Yudie

----- Original Message -----
From: "Jeff Eckermann" <jeff_eckermann(at)yahoo(dot)com>
To: "Yudie" <yudie(at)axiontech(dot)com>; <pgsql-sql(at)postgresql(dot)org>
Sent: Friday, April 30, 2004 9:11 AM
Subject: Re: [SQL] isnumeric() function?

--- 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
appropriate.

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

__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
http://hotjobs.sweepstakes.yahoo.com/careermakeover

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2004-04-30 16:19:39 Re: Permissions not working
Previous Message Alain Reymond 2004-04-30 15:06:03 Database structure