pgsql: Cleanup of rewriter and planner handling of Query.hasRowSecurity

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Cleanup of rewriter and planner handling of Query.hasRowSecurity
Date: 2016-11-10 21:16:38
Message-ID: E1c4wi6-0003rO-8Q@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Cleanup of rewriter and planner handling of Query.hasRowSecurity flag.

Be sure to pull up the subquery's hasRowSecurity flag when flattening a
subquery in pull_up_simple_subquery(). This isn't a bug today because
we don't look at the hasRowSecurity flag during planning, but it could
easily be a bug tomorrow.

Likewise, make rewriteRuleAction() pull up the hasRowSecurity flag when
absorbing RTEs from a rule action. This isn't a bug either, for the
opposite reason: the flag should never be set yet. But again, it seems
like good future proofing.

Add a comment explaining why rewriteTargetView() should *not* set
hasRowSecurity when adding stuff to securityQuals.

Improve some nearby comments about securityQuals processing, and document
that field more completely in parsenodes.h.

Patch by me, analysis by Dean Rasheed.

Discussion: <CAEZATCXZ8tb2DV6f=bkhsMV6u_gRcZ0CZBw2J-qU84RxSukZog(at)mail(dot)gmail(dot)com>

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/24aef33804be5d7d71bc3932ced3407fce71e354

Modified Files
--------------
src/backend/optimizer/prep/prepjointree.c | 3 +++
src/backend/rewrite/rewriteHandler.c | 32 ++++++++++++++++++++++++-------
src/include/nodes/parsenodes.h | 9 ++++++++-
3 files changed, 36 insertions(+), 8 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2016-11-11 17:04:17 pgsql: Doc: fix data types of FuncCallContext's call_cntr and max_calls
Previous Message Tom Lane 2016-11-10 20:01:18 pgsql: Re-allow user_catalog_table option for materialized views.