Re: isnumeric() function? - Mailing list pgsql-sql

From Frank Bax
Subject Re: isnumeric() function?
Date
Msg-id 5.2.1.1.0.20040430121848.02a4cda0@pop6.sympatico.ca
Whole thread Raw
In response to Re: isnumeric() function?  ("Yudie" <yudie@axiontech.com>)
List pgsql-sql
At 11:29 AM 4/30/04, Yudie wrote:
>Great the function works, but what does it means?
>SELECT $1 ~ ''^[0-9]+$''
>
>Yudie


The ~ is a pattern matching operator.        ^ matches beginning of string        [0-9] matches any numeric digit 0
thru9.        + matches one or more occurrences of what came before (digits in 
 
this case)        $ matches end of string
The ^ and $ are important - if they were left out, the pattern would match 
a string containing both numeric and non-numeric data.

You can change the + to * if you decide that an empty string should be 
considered numeric.

Frank 



pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Permissions not working
Next
From: Pallav Kalva
Date:
Subject: Re: Permissions not working