José Soares <jose@sferacarta.com> writes:
> --I have the following test data into these tables:
> hygea=> select * from master1;
> code
> -----------
> a
> a1
> a13
> (3 rows)
> hygea=> select * from detail1;
> code
> ----------------
> a13
> a13
> a1
> (3 rows)
> --if I try to join these two tables I have the following (nothing):
> hygea=> select m.*, d.* from master1 m, detail1 d where m.code=d.code;
> code|code
> ----+----
> (0 rows)
> --and now trying with TRIM function... it works!
> hygea=> select m.*, d.* from master1 m, detail1 d where
> trim(m.code)=trim(d.code
> code |code
> -----------+----------------
> a13 |a13
> a13 |a13
> a1 |a1
> (3 rows)
Looks to me like you have differing numbers of trailing spaces in the
entries in each table. If so, this is not a bug.
regards, tom lane