Received: from ara.zf.jcu.cz (ara.zf.jcu.cz [160.217.161.4]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f4LD15A03367 for ; Mon, 21 May 2001 09:01:05 -0400 (EDT) (envelope-from zakkr@zf.jcu.cz) Received: (from zakkr@localhost) by ara.zf.jcu.cz (8.9.3/8.9.3/Debian 8.9.3-21) id PAA05404; Mon, 21 May 2001 15:01:00 +0200 Date: Mon, 21 May 2001 15:01:00 +0200 From: Karel Zak To: Cedar Cox Cc: pgsql-sql@postgresql.org Subject: Re: Case insensitive string comparison? Message-ID: <20010521150059.A5076@ara.zf.jcu.cz> References: <20010515154756.A24706@ara.zf.jcu.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.0.1i In-Reply-To: ; from cedarc@visionforisrael.com on Mon, May 21, 2001 at 12:15:41PM +0300 X-Archive-Number: 200105/225 X-Sequence-Number: 3042 On Mon, May 21, 2001 at 12:15:41PM +0300, Cedar Cox wrote: > > On Tue, 15 May 2001, Karel Zak wrote: > > > On Tue, May 15, 2001 at 02:48:24PM +0200, Borek Lupom?ský wrote: > > > Is there an operator for case insensitive string comparison, or > > > should I use regular expression matching with ~* '^string$'? > > > > possibility: > > > > - use upper() / lower() inside query > > Ok, this is probably a really silly question: which is faster? > I expect they are nearly identical code. Just wondering... > Only one answer will be right ... try all possibility :-) IMHO the 'ILIKE' is the most fast, because it's simple for parser and it's one function. Karel -- Karel Zak http://home.zf.jcu.cz/~zakkr/ C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz