Outer Joins (and need CASE help)

From: "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>
To: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
Cc: Postgres Hackers List <hackers(at)postgresql(dot)org>
Subject: Outer Joins (and need CASE help)
Date: 1999-01-07 18:26:56
Message-ID: 3694FC70.FAD67BC3@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-hackers

> Thomas, do you need help on outer joins?

Yes. I'm going slowly partly because I get distracted with other
Postgres stuff like docs, and partly because I don't understand all of
the pieces I'm working with.

I've identified the place in the MergeJoin code where the null filling
for outer joins needs to happen, and have the "merge walk" code done.
But I don't have the supporting code which actually would know how to
null-fill a result tuple from the left or right. I thought you might be
interested in that?

I've done some work in the parser, and can now do things like:

postgres=> select * from t1 join t2 using (i);
NOTICE: JOIN not yet implemented
i|j|i|k
-+-+-+-
1|2|1|3
(1 row)

But this is just an inner join, and the result isn't quite right since
the second "i" column should probably be omitted. At the moment I
transform it from the syntax above into existing parse nodes, and
everything from there on works.

I don't yet pass an explicit join node into the planner/optimizer, and
that will be the hardest part I assume. Perhaps we can work on that
together.

So, what I'll try to do (soon, in the next few days?) is put in

#ifdef ENABLE_OUTER_JOINS

conditional code into the parser area (already there for the executor)
and commit everything to the development tree. Does that sound OK?

Oh, and if anyone is looking for something to do, I've got a couple of
CASE statements in the case.sql regression test which are commented out
because they crash the backend. They involve references to multiple
tables within a single result column, and in other contexts that
construct works. It would be great if someone had time to track it
down...

- Tom

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Magnus Hagander 1999-01-07 19:22:48 RE: Postgresql INSTALL-file & Windows
Previous Message Bruce Momjian 1999-01-07 17:54:11 Re: [DOCS] Upcoming Attractions, web site

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Meskes 1999-01-07 18:40:33 ecpg patch
Previous Message Jackson, DeJuan 1999-01-07 18:17:09 RE: [HACKERS] Re: [PORTS] vacuum takes too long