Re: LIKE vs =

From: David Wheeler <david(at)kineticode(dot)com>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: SF PostgreSQL Users <sfpug(at)postgresql(dot)org>
Subject: Re: LIKE vs =
Date: 2004-08-23 17:57:09
Message-ID: DAD671A8-F52D-11D8-990D-000A95972D84@kineticode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: sfpug

On Aug 23, 2004, at 10:42 AM, Josh Berkus wrote:

>> Any idea why = works here and LIKE wouldn't?
>
> Yes. I believe that LIKE relies on the database encoding, whereas =
> does a
> direct byte comparison. However, I don't have much experience with
> encoding
> issues, so you might be better off asking someone else.

Yes, well, the database is utf-8, and I'm passing in a utf-8 string. At
least I hope it's utf-8. I created the database like this:

CREATE DATABASE "bricolage" WITH ENCODING 'UNICODE';

> I also recall there there were problems with multi-byte LIKE still
> being
> worked on in 8.0.

Oh, great.

> One question, though, what do you get if you do:
>
> bric=# select * from keyword where name ~ '^λΆν•œμ˜';

No rows.

Regards,

David

--
David Wheeler
President, Kineticode, Inc.
http://www.kineticode.com/
Kineticode. Setting knowledge in motion.[sm]

In response to

Responses

Browse sfpug by date

  From Date Subject
Next Message Josh Berkus 2004-08-23 18:04:49 Re: LIKE vs =
Previous Message David Fetter 2004-08-23 17:46:20 Re: LIKE vs =