Re: [HACKERS] Questions about indexes with text_pattern_ops

2008-02-25 Thread Tom Lane
Gregory Stark <[EMAIL PROTECTED]> writes: > It may be more right in an abstract ideal world -- the reality is that text > collation is annoyingly complex. But this may be a case where we can get away > with just eliding this hassle. If anyone actually complains about it, I think we can point to th

Re: [HACKERS] Questions about indexes with text_pattern_ops

2008-02-25 Thread Gregory Stark
"Tom Lane" <[EMAIL PROTECTED]> writes: > Gregory Stark <[EMAIL PROTECTED]> writes: >> "Tom Lane" <[EMAIL PROTECTED]> writes: >>> How so? If you think this change is a bad idea you'd better speak up >>> PDQ. > >> Well I think it's fine for 'foo ' != 'foo' even if they sort similarly. > >> But I'm

Re: [HACKERS] Questions about indexes with text_pattern_ops

2008-02-25 Thread Tom Lane
Gregory Stark <[EMAIL PROTECTED]> writes: > "Tom Lane" <[EMAIL PROTECTED]> writes: >> How so? If you think this change is a bad idea you'd better speak up >> PDQ. > Well I think it's fine for 'foo ' != 'foo' even if they sort similarly. > But I'm not sure it makes sense for <'foo ','a'> to sort

Re: [HACKERS] Questions about indexes with text_pattern_ops

2008-02-25 Thread Gregory Stark
"Tom Lane" <[EMAIL PROTECTED]> writes: > Gregory Stark <[EMAIL PROTECTED]> writes: >> "Tom Lane" <[EMAIL PROTECTED]> writes: >>> I'm intending to get rid of ~=~ and ~<>~ for 8.4; there's no longer any >>> reason why those slots in the pattern_ops classes can't be filled by the >>> plain = and <> o

Re: [HACKERS] Questions about indexes with text_pattern_ops

2008-02-25 Thread Tom Lane
Gregory Stark <[EMAIL PROTECTED]> writes: > "Tom Lane" <[EMAIL PROTECTED]> writes: >> I'm intending to get rid of ~=~ and ~<>~ for 8.4; there's no longer any >> reason why those slots in the pattern_ops classes can't be filled by the >> plain = and <> operators. (There *was* a reason when they wer

Re: [HACKERS] Questions about indexes with text_pattern_ops

2008-02-25 Thread Gregory Stark
"Tom Lane" <[EMAIL PROTECTED]> writes: > Gregory Stark <[EMAIL PROTECTED]> writes: >> Hm, for a simple = or <> I think it doesn't matter which operator class you >> use. For < or > it would produce different answers. Postgres isn't clever >> enough >> to notice that this is equivalent though so I

Re: [HACKERS] Questions about indexes with text_pattern_ops

2008-02-25 Thread Tom Lane
Gregory Stark <[EMAIL PROTECTED]> writes: > Hm, for a simple = or <> I think it doesn't matter which operator class you > use. For < or > it would produce different answers. Postgres isn't clever > enough > to notice that this is equivalent though so I think you would have to do > something like (

Re: [HACKERS] Questions about indexes with text_pattern_ops

2008-02-25 Thread Gregory Stark
"Kaare Rasmussen" <[EMAIL PROTECTED]> writes: > Hi > > The database is initialized with utf8, so in order for LIKE to use the index > on > a text field, I used text_pattern_ops when I created it. So far so good. > > It's in the documentation, but there's no explanation of why this index will >

[HACKERS] Questions about indexes with text_pattern_ops

2008-02-25 Thread Kaare Rasmussen
Hi The database is initialized with utf8, so in order for LIKE to use the index on a text field, I used text_pattern_ops when I created it. So far so good. It's in the documentation, but there's no explanation of why this index will only work for LIKE searches. How come that I have to have tw