Re: Fwd: Bad Join moment - how is this happening?

From: Jamie Lawrence <postgres(at)jal(dot)org>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Fwd: Bad Join moment - how is this happening?
Date: 2003-08-01 17:02:42
Message-ID: 20030801170242.GG1073@jal.clueinc.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Sorry to be slow on responses... Thanks to everyone who replies.

On Wed, 30 Jul 2003, Richard Huxton wrote:

> On Wednesday 30 July 2003 21:07, Jamie Lawrence wrote:
> > I fully admit that I've been staring at this too long, and simply don't
> > understand what is wrong. Apologies aside, any kind sql hackers who care
> > to look this over will earn my undying gratitude, and a beer in the bar
> > of your choice, should we ever meet.
>
> I'll take that beer (assuming I'm right)

I think you nailed it first. You appear to be in London, which I haven't
made it to in ~15 years, and mailing it is probably a bad idea. Ever
make it to the NYC area?

> > I appear to be getting a cartesean product when I select against the view
> > 'addenda', when I want a left inner join. That is, I want documents
> > records matched to addenda records only when there is a record in
> > d_addenda with a documents_id that matches the id field in documents.
>
> I think this is the "adding a table into the FROM" feature of PG. You're
> referring to documents.xxx in the select and d.id in the FROM. PG tries to
> help out by adding the table into the FROM for you - hence cartesian join.
>
> I think you can turn this "feature" off in the config file in 7.3.x (haven't
> checked this though)

This was exactly it. Thanks for the help, this was really making me
crazy.

-j

--
Jamie Lawrence jal(at)jal(dot)org
anger, bargaining, depression, and, finally, acceptance

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message tomg 2003-08-01 18:27:05 What day is it - when it isn't NOW()?
Previous Message Christopher Browne 2003-08-01 15:57:44 Re: duplicate dates