Mike Mascari <mascarm@mascari.com> writes:
> I apologize. The pg_stat_activity view is a good example of using views
> atop functions to provide security. Its not exactly obvious, but it can
> be done. And with the SRFs coming, I suppose fixing views is a pretty
> low priority...
I've applied the attached patch, which changes the behavior in your
example case. However, in general I do not think it's possible or
desirable to guarantee anything about order of evaluation of WHERE
clauses.
regards, tom lane
*** src/backend/optimizer/plan/planner.c.orig Sat May 18 14:49:41 2002
--- src/backend/optimizer/plan/planner.c Thu Jun 13 11:01:09 2002
***************
*** 656,662 ****
if (childlen <= 1 || (childlen + myothers) <= geqo_rels / 2)
{
newlist = nconc(newlist, subf->fromlist);
! f->quals = make_and_qual(f->quals, subf->quals);
}
else
newlist = lappend(newlist, child);
--- 656,662 ----
if (childlen <= 1 || (childlen + myothers) <= geqo_rels / 2)
{
newlist = nconc(newlist, subf->fromlist);
! f->quals = make_and_qual(subf->quals, f->quals);
}
else
newlist = lappend(newlist, child);