Re: RIGHT JOIN is only supported with mergejoinable join

From: "Josh Berkus" <josh(at)agliodbs(dot)com>
To: <nickf(at)ontko(dot)com>, "PGSQL-SQL" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: RIGHT JOIN is only supported with mergejoinable join
Date: 2001-11-07 16:49:10
Message-ID: web-500809@davinci.ethosmedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

Nick,

> RIGHT JOIN is only supported with mergejoinable join conditions

Woof! Talk about destruction testing. You have ... let's see ... a
three-column right join on two right-joined tables. If you ahve
uncovered a bug, I wouldn't be surprised.

However, are you sure you want RIGHT OUTER JOINS and not LEFT? Try
re-organizing the query as LEFT JOINS, and see if it works.

create view demo as
     select
       case_data.case_id,
       case_disposition_code.case_disp_global_desc,
       local_case_type.global_case_type_desc
     from
       ( case_data
         left join
case_disposition_code
         on
         case_data.case_disp_local_code =
         case_disposition_code.case_disp_local_code
       )
LEFT JOIN local_case_type 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
       ));

If that doesn't work, try making the case_data and case_disposition_code
join into a subselect.

-Josh

______AGLIO DATABASE SOLUTIONS___________________________
Josh Berkus
Complete information technology josh(at)agliodbs(dot)com
and data management solutions (415) 565-7293
for law firms, small businesses fax 621-2533
and non-profit organizations. San Francisco

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message julian felipe castrillon 2001-11-07 17:06:57
Previous Message Nick Fankhauser 2001-11-07 16:16:38 RIGHT JOIN is only supported with mergejoinable join conditions

Browse pgsql-sql by date

  From Date Subject
Next Message John D. Rozeboom 2001-11-07 16:53:55 Re: Need help with embedded CASEs
Previous Message Josh Berkus 2001-11-07 16:35:04 Re: Increasing MAX_ARGS