X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 410C452830 for ; Thu, 19 May 2005 16:20:18 -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 46627-05 for ; Thu, 19 May 2005 19:20:08 +0000 (GMT) Received: from koolancexeon.g2switchworks.com (mail.g2switchworks.com [63.87.162.25]) by svr1.postgresql.org (Postfix) with ESMTP id 1410852864 for ; Thu, 19 May 2005 16:20:06 -0300 (ADT) Received: mail.g2switchworks.com 10.10.1.8 from 10.10.1.37 10.10.1.37 via HTTP with MS-WebStorage 6.5.6944 Received: from state.g2switchworks.com by mail.g2switchworks.com; 19 May 2005 14:20:16 -0500 Subject: Re: how to ignore case From: Scott Marlowe To: lorid Cc: pgsql-admin@postgresql.org In-Reply-To: <428CE06C.9060604@dri.edu> References: <428CE06C.9060604@dri.edu> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1116530416.31821.103.camel@state.g2switchworks.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Thu, 19 May 2005 14:20:16 -0500 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200505/257 X-Sequence-Number: 17686 On Thu, 2005-05-19 at 13:52, lorid wrote: > How can I do a simple select statement ignoring the case ? kinda like \i > in reg expressions ? > > thanks in advance You can use upper/lower: select * from table where lower(somefield) like '%abc%'; or REGEX: select * from table where lower ~* '.*abc.*'; SEe: http://www.postgresql.org/docs/8.0/static/functions-matching.html#FUNCTIONS-POSIX-TABLE