> You mean that "a1 " is not equal to "a1 " ?
> but PostgreSQL has a different behavior in the following example:
You will have to give more details on your schema and data entry for
us to see the problem; things look good to me too. Examples below...
- Thomas
postgres=> create table t1 (v3 varchar(3), v5 varchar(5), c3 char(3),
c5 char(5));
CREATE
postgres=> insert into t1 values ('a1 ', 'a1 ', 'a1', 'a1');
INSERT 150220 1
postgres=> select * from t1 where v3 = v5;
v3|v5|c3|c5
--+--+--+--
(0 rows)
postgres=> select * from t1 where c3 = c5;
v3 |v5 |c3 |c5
---+-----+---+-----
a1 |a1 |a1 |a1
(1 row)
postgres=> select * from t1 where trim(v3) = trim(v5);
v3 |v5 |c3 |c5
---+-----+---+-----
a1 |a1 |a1 |a1
(1 row)
postgres=> insert into t1 values ('a2', 'a2', 'a2', 'a2');
INSERT 150221 1
postgres=> select * from t1 where v3 = v5;
v3|v5|c3 |c5
--+--+---+-----
a2|a2|a2 |a2
(1 row)
--
Thomas Lockhart lockhart@alumni.caltech.edu
South Pasadena, California