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 1A11114B286C for ; Mon, 9 Aug 2004 00:40:44 -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 53138-01 for ; Mon, 9 Aug 2004 03:40:39 +0000 (GMT) Received: from smtp015.mail.yahoo.com (smtp015.mail.yahoo.com [216.136.173.59]) by svr1.postgresql.org (Postfix) with SMTP id A21CD14B287B for ; Mon, 9 Aug 2004 00:40:37 -0300 (ADT) Received: from unknown (HELO jupiter.black-lion.info) (janwieck@68.80.245.191 with login) by smtp015.mail.yahoo.com with SMTP; 9 Aug 2004 03:40:35 -0000 Received: from [172.21.8.18] ([192.168.192.101]) (authenticated bits=0) by jupiter.black-lion.info (8.12.10/8.12.9) with ESMTP id i793eY3v066750; Sun, 8 Aug 2004 23:40:34 -0400 (EDT) (envelope-from JanWieck@Yahoo.com) Message-ID: <4116F233.5040402@Yahoo.com> Date: Sun, 08 Aug 2004 23:40:35 -0400 From: Jan Wieck User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.1) Gecko/20040707 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Gordon Ross Cc: pgsql-sql@postgresql.org Subject: Re: Make a column case insensitive References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200408/57 X-Sequence-Number: 18554 On 8/6/2004 11:29 AM, 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 !) > > (I'm on 7.4.3) With a little bit of legwork you can create an itext data type. It would just use textin() and textout() for the data type declaration itself. From there you'd define a bunch of comparision operators that are based on sql functions doing case insensitive comparision, plus an operator class and a couple of implicit casts. I don't think you'd even need a single line of C code for that new data type. Jan > > Thanks, > > GTG > > Gordon Ross, > Network Manager/Rheolwr Rhydwaith > Countryside Council for Wales/Cyngor Cefn Gwlad Cymru > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== JanWieck@Yahoo.com #