Re: Isnumeric function?

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: Isnumeric function?
Дата
Msg-id 200409091146.14444.josh@agliodbs.com
обсуждение исходный текст
Ответ на Re: Isnumeric function?  (Theo Galanakis <Theo.Galanakis@lonelyplanet.com.au>)
Список pgsql-sql
Theo,

> Does anyone have any better suggestions???

Well, one suggestion would be to take a machete to your application.  Putting 
key references and text data in the same column?   Sheesh.

If that's not an option, in addition to the approach you've taken, you could 
also do a partial index on the appropriate numeric values:

CREATE INDEX idx_content_numeric ON botched_table(content)
WHERE content ~ '^[0-9]{1,9}$';

However, this approach may be more/less effective that the segregation 
approach you've already taken.

-- 
Josh Berkus
Aglio Database Solutions
San Francisco


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

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: Datetime conversion in WHERE clause
Следующее
От: Theo Galanakis
Дата:
Сообщение: Re: Isnumeric function?