RIGHT JOIN is only supported with mergejoinable join conditions

From: "Nick Fankhauser" <nickf(at)ontko(dot)com>
To: "PGSQL-SQL" <pgsql-sql(at)postgresql(dot)org>
Subject: RIGHT JOIN is only supported with mergejoinable join conditions
Date: 2001-11-07 16:16:38
Message-ID: NEBBLAAHGLEEPCGOBHDGGEDJDOAA.nickf@ontko.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

Hi-

I'm on version 7.1, and I'm getting this error when attempting to select
from a view:

RIGHT JOIN is only supported with mergejoinable join conditions

I don't understand what this error is telling me...

The script I have used to create the view is below pasted in below.
Essentially, I have a main table which I want to see every row from. I also
have two separate lookup tables that I want to get a description field from
*if* there is a matching code in a corresponding nullable field in the main
table. I tried pasting this into MSAccess, and it works fine there. (I know
this doesn't necessarily mean it is valid SQL <grin>.)

My questions are:
1)Have I done something wrong here, or am I hitting a limitation of
PostgreSQL?
2)In either case, how could I re-write this to make it work with PostgreSQL?

Thanks!

-Nick

create view demo as
select
case_data.case_id,
case_disposition_code.case_disp_global_desc,
local_case_type.global_case_type_desc
from
local_case_type
right join
(
case_disposition_code
right join
case_data
on
case_disposition_code.case_disp_local_code =
case_data.case_disp_local_code
)
on
(
local_case_type.court_id =
case_data.court_id
)
and
(
local_case_type.local_case_subtype_code =
case_data.local_case_type_code
)
and
(
local_case_type.local_case_subtype_code =
case_data.local_case_subtype_code
);

--------------------------------------------------------------------------
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/

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2001-11-07 16:49:10 Re: RIGHT JOIN is only supported with mergejoinable join
Previous Message Bruce Momjian 2001-11-07 15:25:52 Re: Status of 7.2

Browse pgsql-sql by date

  From Date Subject
Next Message Ernesto Freyre 2001-11-07 16:21:17 help with sintaxis of quotes on function
Previous Message Denis Bucher 2001-11-07 15:58:31 Need help with embedded CASEs