pgsql: Clean up includes from RLS patch

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Clean up includes from RLS patch
Date: 2014-11-14 22:05:25
Message-ID: E1XpOzd-0000Jb-24@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Clean up includes from RLS patch

The initial patch for RLS mistakenly included headers associated with
the executor and planner bits in rewrite/rowsecurity.h. Per policy and
general good sense, executor headers should not be included in planner
headers or vice versa.

The include of execnodes.h was a mistaken holdover from previous
versions, while the include of relation.h was used for Relation's
definition, which should have been coming from utils/relcache.h. This
patch cleans these issues up, adds comments to the RowSecurityPolicy
struct and the RowSecurityConfigType enum, and changes Relation->rsdesc
to Relation->rd_rsdesc to follow Relation field naming convention.

Additionally, utils/rel.h was including rewrite/rowsecurity.h, which
wasn't a great idea since that was pulling in things not really needed
in utils/rel.h (which gets included in quite a few places). Instead,
use 'struct RowSecurityDesc' for the rd_rsdesc field and add comments
explaining why.

Lastly, add an include into access/nbtree/nbtsort.c for
utils/sortsupport.h, which was evidently missed due to the above mess.

Pointed out by Tom in 16970(dot)1415838651(at)sss(dot)pgh(dot)pa(dot)us; note that the
concerns regarding a similar situation in the custom-path commit still
need to be addressed.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/80eacaa3cdcd10383c333f6f4625af8cee1f7bee

Modified Files
--------------
src/backend/access/nbtree/nbtsort.c | 1 +
src/backend/commands/policy.c | 3 ++-
src/backend/rewrite/rowsecurity.c | 2 +-
src/backend/utils/cache/relcache.c | 17 +++++++++--------
src/include/rewrite/rowsecurity.h | 27 ++++++++++++++-------------
src/include/utils/rel.h | 4 ++--
6 files changed, 29 insertions(+), 25 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2014-11-14 22:20:08 pgsql: Document evaluation-order considerations for aggregate functions
Previous Message Alvaro Herrera 2014-11-14 20:36:36 pgsql: Document BRIN's pages_per_range in CREATE INDEX