X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 751BF52924 for ; Wed, 10 Aug 2005 10:51:59 -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 80278-03 for ; Wed, 10 Aug 2005 13:51:55 +0000 (GMT) Received: from smtp-bedford.mitre.org (smtp-bedford-x.mitre.org [192.160.51.76]) by svr1.postgresql.org (Postfix) with ESMTP id 3BCC252923 for ; Wed, 10 Aug 2005 10:51:54 -0300 (ADT) Received: from smtp-bedford.mitre.org (localhost.localdomain [127.0.0.1]) by smtp-bedford.mitre.org (8.11.6/8.11.6) with SMTP id j7ADpw410085 for ; Wed, 10 Aug 2005 09:51:58 -0400 Received: from smtp-bedford.mitre.org (localhost.localdomain [127.0.0.1]) by smtp-bedford.mitre.org (Postfix) with ESMTP id 03685BF7D for ; Wed, 10 Aug 2005 09:51:58 -0400 (EDT) Received: from MAILHUB2 (mailhub2.mitre.org [129.83.28.8]) by smtp-bedford.mitre.org (8.11.6/8.11.6) with ESMTP id j7ADpvt10052; Wed, 10 Aug 2005 09:51:57 -0400 Received: from thelonious.mitre.org (129.83.51.56) by mailhub2.mitre.org with SMTP id 13912764; Wed, 10 Aug 2005 09:51:56 -0400 (EDT) In-Reply-To: References: Mime-Version: 1.0 (Apple Message framework v622) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <9edcc3260f4ffac66b6f02acfe17bf8a@mitre.org> Content-Transfer-Encoding: 7bit Cc: From: "John D. Burger" Subject: Re: Case sensitivity Date: Wed, 10 Aug 2005 09:53:23 -0400 To: "Frank Millman" X-Mailer: Apple Mail (2.622) X-Virus-Scanned: by amavisd-new at hub.org X-Archive-Number: 200508/495 X-Sequence-Number: 81903 > To handle searching for a row based on a string, I will use > "LOWER(colname) > = 'x'" and "LOWER(colname) LIKE 'x%'". AFAICT, the second one is > equivalent > to "colname ILIKE 'x%'", provided I force 'x' to lowercase first. I would strongly suggest you do this instead: LOWER(colname) = LOWER('x') This is far more bullet-proof than lower-casing in the client, in case the client and the server differ (mismatched locales, etc.). If you don't want to use ILIKE for portability reasons (perfectly reasonable), I suggest the analogous: LOWER(colname) LIKE LOWER('x%') - John D. Burger MITRE