Brian Hirt <bhirt@mobygames.com> writes:
> I've run into a really strange problem that's taken a while for
> me to track down, but I think I have enough information here
> for people to verify what I'm saying and hopefully enough information
> to point someone in the right direction for fixing.
Nasty. Looks like the problem is that Materialize isn't paying
attention to chgParam (boo hiss), so when the subplan is re-executed
with successive g.id values, it keeps handing back the same rows
it computed on the first time through. You only see a failure if
one of the subplans under the Materialize pays attention to g.id
(else the result *should* be the same each time), which is why the
failure comes and goes with different plans.
This actually works correctly in current sources, because I had
rewritten nodeMaterial awhile back and put in the same ReScan
logic that I saw in other plan node types --- I just did that on
general principles, not thinking that it was a live bug fix.
So it hadn't occurred to me to try to back-patch that change,
but clearly we need to do something about it for 7.0.3.
I'll see what I can do about it...
regards, tom lane