Re: Isnumeric function?

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Theo Galanakis <Theo(dot)Galanakis(at)lonelyplanet(dot)com(dot)au>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Isnumeric function?
Date: 2004-09-09 18:46:14
Message-ID: 200409091146.14444.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Collin Peters 2004-09-09 19:54:05 Using UPDATE FROM
Previous Message Josh Berkus 2004-09-09 18:42:41 Re: Datetime conversion in WHERE clause