Search Postgresql Archives

Re: select statement fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux