Re: select statement fails - Mailing list pgsql-general

From Richard Huxton
Subject Re: select statement fails
Date
Msg-id 47FC854B.1080106@archonet.com
Whole thread Raw
In response to select statement fails  ("Andrus" <kobruleht2@hot.ee>)
List pgsql-general
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;

It doesn't return rows because you're using a space-padded type (char)
to try and store a space.

I think you probably want varchar(1) instead.

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: wrong query result
Next
From: Kevin Hunter
Date:
Subject: Re: Trouble with foreign key