pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Yudie <yudie@axiontech.com>
To: pgsql-sql@postgresql.org
Subject: Re: isnumeric() function?
Date: Fri, 30 Apr 2004 10:29:16 -0500
Message-ID: <003601c42ec7$e7806ee0$8401a8c0@home.axiontech.com> (raw)
References: <20040430141145.40776.qmail@web20809.mail.yahoo.com>

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

Yudie 

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


--- Yudie <yudie@axiontech.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@postgresql.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





view thread (29+ messages)  latest in thread

Message-ID: <003601c42ec7$e7806ee0$8401a8c0@home.axiontech.com>
Permalink:  ../003601c42ec7$e7806ee0$8401a8c0@home.axiontech.com/
Also on:    postgresql.org/message-id/003601c42ec7$e7806ee0$8401a8c0@home.axiontech.com

 · 

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: yudie@axiontech.com
  Subject: Re: isnumeric() function?
  In-Reply-To: <003601c42ec7$e7806ee0$8401a8c0@home.axiontech.com>

* 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