Andrus wrote:
> Any idea why the following select statement does not return rows ?
> This select statement is generated by npgsql2 beta 3 so I
> cannot change it in my application.
> How to fix without changing select statement ?
> 
> Andrus.
> 
> create temp table test ( tc char(1) );
> insert into test values(' ');
> select * from test where tc=' '::text;

Because the arguments to the operator "=" are of different type,
implicit type conversion takes place.
"character(1)" will by converted to "text", during this conversion
trailing blanks will be ignored, as befits the "character(n)" type.

You can get what you probably want by:

create temp table test ( tc varchar(1) );

Yours,
Laurenz Albe

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to