Received: from oxmail.ox.ac.uk (oxmail3.ox.ac.uk [163.1.2.9]) by hub.org (8.9.3/8.9.3) with ESMTP id DAA96447 for ; Fri, 13 Aug 1999 03:50:45 -0400 (EDT) (envelope-from moray.mcconnachie@computing-services.oxford.ac.uk) Received: from heraldgate1.oucs.ox.ac.uk ([163.1.2.49] helo=frontend1.herald.ox.ac.uk ident=exim) by oxmail.ox.ac.uk with esmtp (Exim 2.10 #1) id 11FC6u-00017v-00 for pgsql-sql@postgresql.org; Fri, 13 Aug 1999 08:50:44 +0100 Received: from moraypc.oucs.ox.ac.uk ([163.1.14.118] helo=moraypc) by frontend1.herald.ox.ac.uk with smtp (Exim 2.02 #1) id 11FC6u-0001g3-00 for pgsql-sql@postgreSQL.org; Fri, 13 Aug 1999 08:50:44 +0100 Message-ID: <002801bee560$2e499d30$760e01a3@oucs.ox.ac.uk> From: "Moray McConnachie" To: References: <003401bee4d3$42774e20$0200a8c0@mike> <37B2E714.DB904C2B@bart.w-wa.pl> Subject: Re: [SQL] Searching Text Fields - Case Sensitive? Date: Fri, 13 Aug 1999 08:48:06 +0100 Organization: Oxford University MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 ----- Original Message ----- From: Bart Ogryczak To: Sent: Thursday, August 12, 1999 4:24 PM Subject: Re: [SQL] Searching Text Fields - Case Sensitive? > > SELECT * FROM mydb WHERE description LIKE "%foobar%"; > > it seems to be case sensitive. Is there a way to do it so it is NOT > > case-sensitive? > SELECT * FROM mydb WHERE lower(description) LIKE "%foobar%"; Brings up an interesting question. Which is faster, to use the lower/upper functions as above (and of course if foobar is a variable, it would also have to be made lower case by the program calling pgsql), or to use the pattern matching case-insensitive operator? Yours, Moray