Re: RIGHT JOIN is only supported with mergejoinable join conditions

From: "Nick Fankhauser" <nickf(at)ontko(dot)com>
To: "Josh Berkus" <josh(at)agliodbs(dot)com>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "PGSQL-SQL" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: RIGHT JOIN is only supported with mergejoinable join conditions
Date: 2001-11-07 22:22:13
Message-ID: NEBBLAAHGLEEPCGOBHDGEEEGDOAA.nickf@ontko.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

Tom, Josh:

Thanks for the ideas! Tom's idea was the easiest to test, so I tried it
first, and it worked! As you surmised, there was a typo, so I removed the
extra "sub".

I agree that this still may be a bug. These tables have been migrated
forward from an older postgresql version & hence have no primary or foreign
key constraints that might tip off the planner about my typo - as far as the
database knows, these are just two varchar fields in separate tables. Your
thought about the overlap causing the problem seems likely since this seems
to be a valid query, even with the typo.

At any rate, my immediate problem is solved & I'm a happy camper!

Thanks.

-Nick

--------------------------------------------------------------------------
Nick Fankhauser nickf(at)ontko(dot)com Phone 1.765.935.4283 Fax 1.765.962.9788
Ray Ontko & Co. Software Consulting Services http://www.ontko.com/

> -----Original Message-----
> From: pgsql-sql-owner(at)postgresql(dot)org
> [mailto:pgsql-sql-owner(at)postgresql(dot)org]On Behalf Of Tom Lane
> Sent: Wednesday, November 07, 2001 2:06 PM
> To: nickf(at)ontko(dot)com
> Cc: PGSQL-SQL
> Subject: Re: [SQL] RIGHT JOIN is only supported with mergejoinable join
> conditions
>
>
> "Nick Fankhauser" <nickf(at)ontko(dot)com> writes:
> > and
> > (
> > local_case_type.local_case_subtype_code =
> > case_data.local_case_type_code
> > )
>
> Did you actually mean to match local_case_subtype_code against
> local_case_type_code, or is that a typo?
>
> I believe you have uncovered a planner bug, but the bug may be triggered
> by the partial overlap of this join condition with the next one.
> Assuming that it's a typo, you may find that you avoid the problem by
> fixing the typo.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Jacobs 2001-11-07 22:39:27 7.2 Beta2 bug report
Previous Message Rene Pijlman 2001-11-07 22:01:13 Re: Funny timezone shift causes failure in test suite

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2001-11-07 22:48:20 Re: RIGHT JOIN is only supported with mergejoinable join conditions
Previous Message wyatt 2001-11-07 21:01:33 Single VIEW, Everybody JOIN!