Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 0B86D475F6E for ; Thu, 19 Sep 2002 10:42:07 -0400 (EDT) Received: from aragorn.reaumur.absolight.net (ATuileries-113-2-1-126.abo.wanadoo.fr [80.11.216.126]) by postgresql.org (Postfix) with ESMTP id 5E510475F27 for ; Thu, 19 Sep 2002 10:42:04 -0400 (EDT) Received: from andromede.reaumur.absolight.net (andromede.reaumur.absolight.net [212.43.217.61]) by aragorn.reaumur.absolight.net (Postfix) with ESMTP id A72767E8C; Thu, 19 Sep 2002 16:41:53 +0200 (CEST) Date: Thu, 19 Sep 2002 16:41:23 +0200 From: Mathieu Arnold To: thorbjorn.eriksson@ec.se Cc: pgsql-sql@postgresql.org Subject: Re: Stripping white-space in SELECT statments Message-ID: <543384405.1032453683@andromede.reaumur.absolight.net> In-Reply-To: References: X-Mailer: Mulberry/3.0.0b3 (Win32) X-wazaaa: True, true MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/220 X-Sequence-Number: 9497 --On jeudi 19 septembre 2002 13:20 +0200 Thorbj=F6rn Eriksson wrote: > Hello, >=20 > I've encountered a strange behavior in postgres 7.2.1 regarding how psql > handles strings ending with space characters. >=20 > If I want to search for records where the first column (artnrgrpmtrln_1) > begins with > '201901 ', our system that uses the database creates the following SQL > statement: >=20 > select artnrgrpmtrln_1 from sr where (artnrgrpmtrln_1>=3D'201901 ' and > artnrgrpmtrln_1<=3D'201901 =FF' and why not=20 select artnrgrpmtrln_1 from sr where substr(artnrgrpmtrln_1, 0, 9) =3D '201901 ' --=20 Mathieu Arnold