subselects - Mailing list pgsql-hackers

From Bruce Momjian
Subject subselects
Date
Msg-id 199801202218.RAA15186@candle.pha.pa.us
Whole thread Raw
List pgsql-hackers
I have completed adding Var.varlevelsup, and have added code to the
parser to properly set the field.  It will allow correlated references
in the WHERE clause, but not in the target list.

I did not make many changes in the optimizer or executor because I
believed varlevelsup would be zero by the time it got to that point.
For example, there are cases where the optimizer calls getrelid(Var *,
RangeTable), and of course, because we don't have a parentQuery* in the
Query, this will ignore the varlevelsup and only look in the current
range table.

I did make a few additions of varlevelsup in cases where they were
checking for equality or copying Var records.  I made changes in all the
support code, like /nodes handling.

Let me know if you need additional changes.  makeVar takes a new
varlevelsup parameter, and I made changes to all calls.

I have tested the code, and debug output shows varlevelsup being set
correctly.

The only open item is how to do rewrite.  I will check into this later,
probably in a week.  It will work by Feb 1.

--
Bruce Momjian
maillist@candle.pha.pa.us

pgsql-hackers by date:

Previous
From: James Hughes
Date:
Subject: Re: [HACKERS] Authentication Woes
Next
From: Bruce Momjian
Date:
Subject: subselects