Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 991049FB63A for ; Thu, 28 Jun 2007 11:43:46 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 85443-03 for ; Thu, 28 Jun 2007 11:43:43 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.236]) by postgresql.org (Postfix) with ESMTP id B5F6E9FB621 for ; Thu, 28 Jun 2007 11:43:42 -0300 (ADT) Received: by nz-out-0506.google.com with SMTP id l8so66777nzf for ; Thu, 28 Jun 2007 07:43:41 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=GQXNqdhoZtB39VIiDN/oQ0/VNa+5LSUVKa3ZbbN3ruMskMFGJ3zmR+To+NVMueX4CDbPtNjG8XfxqGnman7A8c1AV0qqOacFeyFwcMvtB+Rvn+chEXN7/1p5X3JIEBI/tJeiDt5SzFuhNAOLZ1UIU/C6kr9T+/0YsWtRnWEqB1k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=lmrogKXEJ2CiU9/pxGQBfKtf+uRMpsvil3qHqPEaZUcYm/QmdoGhh4+xSltUDjZLAMtTyczl10TcYQ2bJbeYhd4JG+XMku20MreyR7oayxnO+7E+SLd9RfNy81srWCKT1notJFjAKLTeCx5YxS4YFNqeUGeQLl4gXC9RhUz8DI8= Received: by 10.142.51.4 with SMTP id y4mr115715wfy.1183041820691; Thu, 28 Jun 2007 07:43:40 -0700 (PDT) Received: by 10.142.88.4 with HTTP; Thu, 28 Jun 2007 07:43:40 -0700 (PDT) Message-ID: <162867790706280743s782ff019nac0510253d158dee@mail.gmail.com> Date: Thu, 28 Jun 2007 16:43:40 +0200 From: "Pavel Stehule" To: "Andreas Joseph Krogh" Subject: Re: Is index usage in LIKE-queries with UTF-8 implemented in PG-8.3 ? Cc: pgsql-sql@postgresql.org In-Reply-To: <200706281630.16455.andreak@officenet.no> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <200706281630.16455.andreak@officenet.no> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/233 X-Sequence-Number: 28723 Hello, it's possible. You have to use varchar_pattern_ops: CREATE INDEX like_index ON person(name varchar_pattern_ops); Regards Pavel Stehule 2007/6/28, Andreas Joseph Krogh : > Hi all. > Anybody knows if the following query will use an index-scan in PG-8.3? > > SELECT name FROM person WHERE name LIKE 'and%'; > > I know this works in "C"-locale, but I need it with UTF-8, probably the r= est > of the world soon too... > > -- > Andreas Joseph Krogh > Senior Software Developer / Manager > ------------------------+---------------------------------------------+ > OfficeNet AS | The most difficult thing in the world is to | > Karenslyst All=E9 11 | know how to do a thing and to watch | > PO. Box 529 Sk=F8yen | somebody else doing it wrong, without | > 0214 Oslo | comment. | > NORWAY | | > Tlf: +47 24 15 38 90 | | > Fax: +47 24 15 38 91 | | > Mobile: +47 909 56 963 | | > ------------------------+---------------------------------------------+ > > ---------------------------(end of broadcast)--------------------------- > TIP 3: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faq >