Re: [HACKERS] Bug on complex join

From: Oleg Broytmann <phd(at)sun(dot)med(dot)ru>
To: "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [HACKERS] Bug on complex join
Date: 1999-03-05 15:13:50
Message-ID: Pine.SOL2.3.96.SK.990305181036.12319A-100000@sun.med.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi!

On Fri, 5 Mar 1999, Thomas G. Lockhart wrote:
> > SELECT sh.distr_id , d.distr_id
> > FROM central cn, shops sh, districts d
> > WHERE cn.shop_id = sh.shop_id
> > and got 27963 rows.
> > But the query
> > SELECT d.*
> > FROM central cn, shops sh, districts d
> > WHERE cn.shop_id = sh.shop_id AND sh.distr_id = d.distr_id
>
> Why did you change both the target columns *and* the query qualification
> between these two examples? Is the "SELECT d.*" required to get the
> query to fail?? If not, then...

Cause I need something in the target list. Wrong way to test it? What is
a better way?

> For some reason sh.distr_id is not equal to d.distr_id. Are they
> different data types? Do they have some embedded blanks?? Probably not a

Both are int2. No blanks (at least I cannot imagine blanks in int2 :).

> Postgres bug, since the query itself looks pretty simple...

That's why I am very confused. :(

>
> - Tom
>

Oleg.
----
Oleg Broytmann National Research Surgery Centre http://sun.med.ru/~phd/
Programmers don't die, they just GOSUB without RETURN.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Davis 1999-03-05 15:34:11 RE: [HACKERS] for row in select loop question
Previous Message Thomas G. Lockhart 1999-03-05 15:07:08 Re: [HACKERS] Bug on complex join