Re: Is this a bug, possible security hole, or wrong - Mailing list pgsql-general

From Tom Lane
Subject Re: Is this a bug, possible security hole, or wrong
Date
Msg-id 20742.1023981294@sss.pgh.pa.us
Whole thread Raw
In response to Re: Is this a bug, possible security hole, or wrong  (Mike Mascari <mascarm@mascari.com>)
List pgsql-general
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);

pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Troubleshooting SPI_execp() failed in RI_FKey_cascade_del()
Next
From: Vince Vielhaber
Date:
Subject: Re: Once again, nntp://news.postgresql.org is down