Re: Stripping white-space in SELECT statments

From: Mathieu Arnold <mat(at)mat(dot)cc>
To: thorbjorn(dot)eriksson(at)ec(dot)se
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Stripping white-space in SELECT statments
Date: 2002-09-19 14:41:23
Message-ID: 543384405.1032453683@andromede.reaumur.absolight.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

--On jeudi 19 septembre 2002 13:20 +0200 Thorbjörn Eriksson
<thorbjorn(dot)eriksson(at)ec(dot)se> wrote:

> Hello,
>
> I've encountered a strange behavior in postgres 7.2.1 regarding how psql
> handles strings ending with space characters.
>
> 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:
>
> select artnrgrpmtrln_1 from sr where (artnrgrpmtrln_1>='201901 ' and
> artnrgrpmtrln_1<='201901 ÿ'

and why not
select artnrgrpmtrln_1
from sr
where substr(artnrgrpmtrln_1, 0, 9) = '201901 '

--
Mathieu Arnold

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message PostgreSQL Server 2002-09-19 15:56:04 Table Copy.
Previous Message Charles Hauser 2002-09-19 14:41:15 help w/ constructing a SELECT