pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Regular Expressions, LIKE, and indexes
2+ messages / 2 participants
[nested] [flat]

* Regular Expressions, LIKE, and indexes
@ 2006-11-22 19:10 Travis Whitton <tinymountain@gmail.com>
  2006-11-22 19:20 ` Re: Regular Expressions, LIKE, and indexes Richard Huxton <dev@archonet.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Travis Whitton @ 2006-11-22 19:10 UTC (permalink / raw)
  To: pgsql-sql



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Regular Expressions, LIKE, and indexes
  2006-11-22 19:10 Regular Expressions, LIKE, and indexes Travis Whitton <tinymountain@gmail.com>
@ 2006-11-22 19:20 ` Richard Huxton <dev@archonet.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Richard Huxton @ 2006-11-22 19:20 UTC (permalink / raw)
  To: Travis Whitton <tinymountain@gmail.com>; +Cc: pgsql-sql

Travis Whitton wrote:
> 
> SELECT keyword FROM keywords WHERE keyword like 'foo%';
> 
> Are there any other functions that can provide equivalent results while
> using an index, or am going to have drop UTF-8 and recreate my database?

UTF-8 isn't your locale, it's your character set (or encoding). Your 
locale is something like en_GB.UTF-8 (for British sorting).

You need to define your indexes in such a way that the LIKE can figure 
things out. That means using a special operator-class (so that you 
redefine how less-than and greater-than are defined). It takes longer to 
explain than to do, so I'll direct you to the relevant "CREATE INDEX" 
example in the manuals:
   http://www.postgresql.org/docs/8.1/static/indexes-opclass.html

-- 
   Richard Huxton
   Archonet Ltd



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2006-11-22 19:20 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-11-22 19:10 Regular Expressions, LIKE, and indexes Travis Whitton <tinymountain@gmail.com>
2006-11-22 19:20 ` Richard Huxton <dev@archonet.com>

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