Jan Wieck <JanWieck(at)Yahoo(dot)com> writes:
> What is SUM(up1levelvar + up2levelsvar) considered to be? Would that be
> the same as SUM(localvar + outervar) one level up?
Exactly. The spec says that SUM(up1levelvar) is the same as
SUM(localvar) one level up, so this seems a natural generalization.
It lets us keep supporting our old behavior in cases where that behavior
is sensible.
regards, tom lane