Re: Sorting by numerical order - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Sorting by numerical order
Date
Msg-id 20040314230953.GA23397@svana.org
Whole thread Raw
In response to Re: Sorting by numerical order  (Mike Nolan <nolan@gw.tssi.com>)
Responses Re: Sorting by numerical order
List pgsql-general
On Sun, Mar 14, 2004 at 04:59:45PM -0600, Mike Nolan wrote:
> On a somewhat related subject, how difficult would it be to write an
> 'isnumeric' function as part of the source code as opposed to a user
> function in pgsql or perl?

Regular expressions? Something like:

column ~ '^[-+]?[0-9]+(\.[0-9]+)?$'

Should do the trick. Ofcourse, if you're dealing with exponentials
you'll need to add more, browsing the web should give you some
examples.

I don't see writing it in C being significantly faster, but it's
possible I guess.
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> If the Catholic church can survive the printing press, science fiction
> will certainly weather the advent of bookwarez.
>    http://craphound.com/ebooksneitherenorbooks.txt - Cory Doctorow

Attachment

pgsql-general by date:

Previous
From: Eric B.Ridge
Date:
Subject: Re: How reliable are the stats collector stats?
Next
From: Steve Atkins
Date:
Subject: Re: Sorting by numerical order