Re: [PATCHES] LIKE indexing

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] LIKE indexing
Date: 2001-08-20 21:21:21
Message-ID: 10371.998342481@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> Tom Lane writes:
>> The text does seem to say that it's okay to add trailing blanks to the
>> pattern to produce a match, when the collating sequence is PAD SPACE
>> type (bpchar in our terms).

> I can't find that.

The spec says "without the appending of <space> characters to MCV",
not "without the appending of <space> characters" full stop. I read
that to imply that it *is* okay to append spaces to the pattern PCV.
But it's not exactly transparently written in any case.

> I'm also quite suspicious about the wording "...and has the same length as
> that substring specifier."

Yeah, me too. Does that say that space padding isn't allowed? If so,
why the thrashing-about earlier in the sentence? In any case, it seems
to allow a locale-dependent case conversion, for instance.

>> In any case, Hiroshi is dead right that LIKE is supposed to perform
>> collating-sequence-dependent comparison,

> As I have answered to Hiroshi, I think that would really be brain-dead.
> It would alienate LIKE from how pattern matching normally operates.

Well, you make some good arguments, but I'd like to see a fairly strong
consensus that we think the SQL definition of LIKE is broken before we
decide to build a lot of superstructure on our definition of LIKE. So
far I haven't seen many comments on this thread...

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Cramer 2001-08-21 00:08:54 Fully qualified column names
Previous Message Tom Lane 2001-08-20 21:04:06 Re: Re: CREATEDB Where ??

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2001-08-21 00:35:44 Re: New version of XML support routines (0.2)
Previous Message Bruce Momjian 2001-08-20 18:32:08 Re: New version of XML support routines (0.2)