Re: [HACKERS] SELECT BUG - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] SELECT BUG
Date
Msg-id 17572.936192638@sss.pgh.pa.us
Whole thread Raw
In response to SELECT BUG  (José Soares <jose@sferacarta.com>)
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] OID 718 and Circle
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] File descriptor leakage?