Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 5BF0C476355 for ; Thu, 19 Sep 2002 10:34:00 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 3D909475EA9 for ; Thu, 19 Sep 2002 10:31:50 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.5/8.12.5) with ESMTP id g8JEVq5D025712; Thu, 19 Sep 2002 10:31:52 -0400 (EDT) To: thorbjorn.eriksson@ec.se Cc: pgsql-sql@postgresql.org Subject: Re: Stripping white-space in SELECT statments In-reply-to: References: Comments: In-reply-to =?iso-8859-1?Q?Thorbj=F6rn_Eriksson?= message dated "Thu, 19 Sep 2002 13:20:38 +0200" Date: Thu, 19 Sep 2002 10:31:52 -0400 Message-ID: <25711.1032445912@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/217 X-Sequence-Number: 9494 =?iso-8859-1?Q?Thorbj=F6rn_Eriksson?= writes: > I've encountered a strange behavior in postgres 7.2.1 regarding how psql > handles strings ending with space characters. Perhaps you are running in a non-C locale? A lot of locales have sorting rules that are pretty weird about whitespace. > The reason that we don't use 'LIKE 201901 %' is that it don't use > the index This suggests strongly that you are in a non-C locale. Your external software seems to be emulating the standard LIKE-to-index optimization; which as you are now discovering, does not work with non-C sorting rules (so the system doesn't try to apply it). regards, tom lane