pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Pavel Stehule <pavel.stehule@gmail.com>
To: Andreas Joseph Krogh <andreak@officenet.no>
Cc: pgsql-sql@postgresql.org
Subject: Re: Is index usage in LIKE-queries with UTF-8 implemented in PG-8.3 ?
Date: Thu, 28 Jun 2007 16:43:40 +0200
Message-ID: <162867790706280743s782ff019nac0510253d158dee@mail.gmail.com> (raw)
In-Reply-To: <200706281630.16455.andreak@officenet.no>
References: <200706281630.16455.andreak@officenet.no>

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 <andreak@officenet.no>:
> 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 rest
> of the world soon too...
>
> --
> Andreas Joseph Krogh <andreak@officenet.no>
> Senior Software Developer / Manager
> ------------------------+---------------------------------------------+
> OfficeNet AS            | The most difficult thing in the world is to |
> Karenslyst Allé 11      | know how to do a thing and to watch         |
> PO. Box 529 Skøyen      | 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
>



view thread (7+ messages)  latest in thread

Message-ID: <162867790706280743s782ff019nac0510253d158dee@mail.gmail.com>
Permalink:  ../162867790706280743s782ff019nac0510253d158dee@mail.gmail.com/
Also on:    postgresql.org/message-id/162867790706280743s782ff019nac0510253d158dee@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: pavel.stehule@gmail.com, andreak@officenet.no
  Subject: Re: Is index usage in LIKE-queries with UTF-8 implemented in PG-8.3 ?
  In-Reply-To: <162867790706280743s782ff019nac0510253d158dee@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox