OK I found it,
I search in the planner for the '\xFF' appending.
Finally I found in MakeIndexable() in gram.y

Attach a patch which removes the "<=" test in USE_LOCALE,
might make some queries a bit slower for us "locale-heads",
BUT correct result is more important.

	regards,
-- 
-----------------
Gï¿½ran Thyni
This is Penguin Country. On a quiet night you can hear Windows NT
reboot!
Mon, 01 Feb 1999 21:29:55 +0100
Goran Thyni <goran@kirra.net>
New patch (was: tough bug)
Hi!

On Mon, 1 Feb 1999, Goran Thyni wrote:
> Attach a patch which removes the "<=" test in USE_LOCALE,
> might make some queries a bit slower for us "locale-heads",
> BUT correct result is more important.

   I've applied your patch and tested on Debian 2.0, Postgres 6.4.2.
Applied cleanly, compiled. Test for koi8 locale passed well.

Oleg.
---- 
    Oleg Broytmann  National Research Surgery Centre  http://sun.med.ru/~phd/
           Programmers don't die, they just GOSUB without RETURN.


Tue, 2 Feb 1999 19:19:13 +0300 (MSK)
Oleg Broytmann <phd@sun.med.ru>
Re: [HACKERS] New patch (was: tough bug)
Applied.


[Charset iso-8859-1 unsupported, filtering to ASCII...]
> 
> OK I found it,
> I search in the planner for the '\xFF' appending.
> Finally I found in MakeIndexable() in gram.y
> 
> Attach a patch which removes the "<=" test in USE_LOCALE,
> might make some queries a bit slower for us "locale-heads",
> BUT correct result is more important.
> 
> 	regards,
> -- 
> -----------------
> G_ran Thyni
> This is Penguin Country. On a quiet night you can hear Windows NT
> reboot!

> diff -c pgsql/src/backend/parser/gram.y.orig pgsql/src/backend/parser/gram.y
> *** pgsql/src/backend/parser/gram.y.orig	Tue Jan 26 07:02:32 1999
> --- pgsql/src/backend/parser/gram.y	Mon Feb  1 21:16:56 1999
> ***************
> *** 5249,5259 ****
> --- 5249,5265 ----
>   				least->val.val.str = match_least;
>   				most->val.type = T_String;
>   				most->val.val.str = match_most;
> + #ifdef USE_LOCALE
> + 				result = makeA_Expr(AND, NULL,
> + 						makeA_Expr(OP, "~", lexpr, rexpr),
> + 						makeA_Expr(OP, ">=", lexpr, (Node *)least));
> + #else
>   				result = makeA_Expr(AND, NULL,
>   						makeA_Expr(OP, "~", lexpr, rexpr),
>   						makeA_Expr(AND, NULL,
>   							makeA_Expr(OP, ">=", lexpr, (Node *)least),
>   							makeA_Expr(OP, "<=", lexpr, (Node *)most)));
> + #endif
>   			}
>   		}
>   	}
> ***************
> *** 5296,5306 ****
> --- 5302,5318 ----
>   				least->val.val.str = match_least;
>   				most->val.type = T_String;
>   				most->val.val.str = match_most;
> + #ifdef USE_LOCALE
> + 				result = makeA_Expr(AND, NULL,
> + 						makeA_Expr(OP, "~~", lexpr, rexpr),
> + 						makeA_Expr(OP, ">=", lexpr, (Node *)least));
> + #else
>   				result = makeA_Expr(AND, NULL,
>   						makeA_Expr(OP, "~~", lexpr, rexpr),
>   						makeA_Expr(AND, NULL,
>   							makeA_Expr(OP, ">=", lexpr, (Node *)least),
>   							makeA_Expr(OP, "<=", lexpr, (Node *)most)));
> + #endif
>   			}
>   		}
>   	}
> 
> 
> 
> 
> 
> 


-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Tue, 2 Feb 1999 14:20:56 -0500 (EST)
Bruce Momjian <maillist@candle.pha.pa.us>
Re: New patch (was: tough bug)