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 79D635E46BF for ; Sun, 8 Aug 2004 16:27:25 -0300 (ADT) 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 36144-05 for ; Sun, 8 Aug 2004 19:27:20 +0000 (GMT) Received: from tht.net (vista.tht.net [216.126.88.2]) by svr1.postgresql.org (Postfix) with ESMTP id 026B95E4248 for ; Sun, 8 Aug 2004 16:27:18 -0300 (ADT) Received: from [134.22.70.202] (dyn-70-202.tor.dsl.tht.net [134.22.70.202]) by tht.net (Postfix) with ESMTP id 3DCF276B22; Sun, 8 Aug 2004 15:27:20 -0400 (EDT) Subject: Re: Make a column case insensitive From: Rod Taylor To: Gordon Ross Cc: pgsql-sql@postgresql.org In-Reply-To: References: Content-Type: text/plain Message-Id: <1091993235.799.15.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Sun, 08 Aug 2004 15:27:15 -0400 Content-Transfer-Encoding: 7bit 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: 200408/51 X-Sequence-Number: 18548 On Fri, 2004-08-06 at 11:29, Gordon Ross wrote: > Is it possible to make a column case insensitive, without having to pepper your SELECTs with lots of lower() function calls (and forgetting to do it at times !) You could make yourself a set returning function to do this job -- but that is probably just as difficult to remember when selecting data out of the table. create function abc(text) returns set of tab as 'select * from tab where col = lower($1);' language sql; select * from abc('sEaRcH_VaLuE');