Text cast problem

From: "Volkmar Herbst" <herbst(at)gc-i(dot)de>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Text cast problem
Date: 2009-04-02 09:51:30
Message-ID: E5F311726E664432BEB109D30F3D3C26@NotebookVolkmar
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Dear all-

I encountered the following problem:

select * from parcel where number = '255 '

gives me 1 row but

select * from parcel where number = '255 ' ::text

does give me 0 rows. The cast removes the trailing empty character.

Why is that? Unfortunately the statements are generated (NPGSQL) and I can’t change the way they are generated. What can I do? Any suggestions highly welcomed!

Volkmar

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message James Kitambara 2009-04-02 12:31:13 Re: SQL to Check whether "AN HOUR PERIOD" is between start and end timestamps
Previous Message Adrian Klaver 2009-04-01 23:55:58 Re: FUNCTION problem