X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 4FDC7329CFD for ; Thu, 9 Sep 2004 19:46:35 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 48258-09 for ; Thu, 9 Sep 2004 18:46:10 +0000 (GMT) Received: from davinci.ethosmedia.com (server226.ethosmedia.com [209.128.84.226]) by svr1.postgresql.org (Postfix) with ESMTP id AE272329C65 for ; Thu, 9 Sep 2004 19:46:11 +0100 (BST) Received: from [63.195.55.98] (HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.1.8) with ESMTP id 6312789; Thu, 09 Sep 2004 11:47:30 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Organization: Aglio Database Solutions To: Theo Galanakis , pgsql-sql@postgresql.org Subject: Re: Isnumeric function? Date: Thu, 9 Sep 2004 11:46:14 -0700 User-Agent: KMail/1.4.3 References: <82E30406384FFB44AFD1012BAB230B55037D057B@shiva.au.lpint.net> In-Reply-To: <82E30406384FFB44AFD1012BAB230B55037D057B@shiva.au.lpint.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200409091146.14444.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/66 X-Sequence-Number: 18912 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