pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mathieu Arnold <mat@mat.cc>
To: thorbjorn.eriksson@ec.se
Cc: pgsql-sql@postgresql.org
Subject: Re: Stripping white-space in SELECT statments
Date: Thu, 19 Sep 2002 16:41:23 +0200
Message-ID: <543384405.1032453683@andromede.reaumur.absolight.net> (raw)
In-Reply-To: <MFEPJLNKECPAPFDGGEIMEENJCBAA.thorbjorn.eriksson@ec.se>
References: <MFEPJLNKECPAPFDGGEIMEENJCBAA.thorbjorn.eriksson@ec.se>



--On jeudi 19 septembre 2002 13:20 +0200 Thorbjörn Eriksson
<thorbjorn.eriksson@ec.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



view thread (9+ messages)  latest in thread

Message-ID: <543384405.1032453683@andromede.reaumur.absolight.net>
Permalink:  ../543384405.1032453683@andromede.reaumur.absolight.net/
Also on:    postgresql.org/message-id/543384405.1032453683@andromede.reaumur.absolight.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mat@mat.cc, thorbjorn.eriksson@ec.se
  Subject: Re: Stripping white-space in SELECT statments
  In-Reply-To: <543384405.1032453683@andromede.reaumur.absolight.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox