Re: ERROR: FULL JOIN is only supported with merge-joinable join conditions - Mailing list pgsql-general

From Stephen Frost
Subject Re: ERROR: FULL JOIN is only supported with merge-joinable join conditions
Date
Msg-id 20060316201709.GB4474@ns.snowman.net
Whole thread Raw
In response to ERROR: FULL JOIN is only supported with merge-joinable join conditions  (Harco de Hilster <harcoh@ATConsultancy.nl>)
List pgsql-general
* Harco de Hilster (harcoh@ATConsultancy.nl) wrote:
> ERROR:  FULL JOIN is only supported with merge-joinable join conditions

I'm not a big fan of that error either, honestly.

> select *
> from A
> full outer join B on A.f1 = B.f1  and  ((A.ExpTime IS NULL AND B.ExpTime
> IS NULL) OR (A.ModTime <= B.ExpTime AND (B.ExpTime > A.ExpTime OR
> B.ExpTime IS NULL)))

What about:

inner join
union all
left join
union all
right join

?  You'd need to add a couple where clauses to make the left/right joins
only return rows not returned by the inner join.  Honestly, that setup
is pretty ugly though and you might consider trying to figure out a way
to clean it up.

It'd be nice if Postgres would basically just do this for you. :/
Perhaps one of the other folks can explain why it doesn't just work.

    Enjoy,

        Stephen

Attachment

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: Replication & web apps
Next
From: Tom Lane
Date:
Subject: Re: How do I make a timestamp column default to current time