Re: Sorting by numerical order

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Sorting by numerical order
Дата
Msg-id 20040314230953.GA23397@svana.org
обсуждение исходный текст
Ответ на Re: Sorting by numerical order  (Mike Nolan <nolan@gw.tssi.com>)
Ответы Re: Sorting by numerical order
Список 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

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Eric B.Ridge
Дата:
Сообщение: Re: How reliable are the stats collector stats?
Следующее
От: Steve Atkins
Дата:
Сообщение: Re: Sorting by numerical order