pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Use appropriate command type when retrieving relation's policies
2+ messages / 1 participants
[nested] [flat]

* pgsql: Use appropriate command type when retrieving relation's policies
@ 2015-07-30 16:39  Joe Conway <mail@joeconway.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Joe Conway @ 2015-07-30 16:39 UTC (permalink / raw)
  To: pgsql-committers

Use appropriate command type when retrieving relation's policies.

When retrieving policies, if not working on the root target relation,
we actually want the relation's SELECT policies, regardless of
the top level query command type. For example in UPDATE t1...FROM t2
we need to apply t1's UPDATE policies and t2's SELECT policies.
Previously top level query command type was applied to all relations,
which was wrong. Add some regression coverage to ensure we don't
violate this principle in the future.

Report and patch by Dean Rasheed. Cherry picked from larger refactoring
patch and tweaked by me. Back-patched to 9.5 where RLS was introduced.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/1e15b212290bf6daff752f20e9e0356e4dac6e09

Modified Files
--------------
src/backend/rewrite/rowsecurity.c         |   12 ++++-
src/test/regress/expected/rowsecurity.out |   83 +++++++++++++++++++++++++++++
src/test/regress/sql/rowsecurity.sql      |   40 ++++++++++++++
3 files changed, 134 insertions(+), 1 deletion(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Use appropriate command type when retrieving relation's policies
@ 2015-07-30 16:39  Joe Conway <mail@joeconway.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Joe Conway @ 2015-07-30 16:39 UTC (permalink / raw)
  To: pgsql-committers

Use appropriate command type when retrieving relation's policies.

When retrieving policies, if not working on the root target relation,
we actually want the relation's SELECT policies, regardless of
the top level query command type. For example in UPDATE t1...FROM t2
we need to apply t1's UPDATE policies and t2's SELECT policies.
Previously top level query command type was applied to all relations,
which was wrong. Add some regression coverage to ensure we don't
violate this principle in the future.

Report and patch by Dean Rasheed. Cherry picked from larger refactoring
patch and tweaked by me. Back-patched to 9.5 where RLS was introduced.

Branch
------
REL9_5_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/23b5e726da6ef5ebbc1dbc821320ee35fa1d0737

Modified Files
--------------
src/backend/rewrite/rowsecurity.c         |   12 ++++-
src/test/regress/expected/rowsecurity.out |   83 +++++++++++++++++++++++++++++
src/test/regress/sql/rowsecurity.sql      |   40 ++++++++++++++
3 files changed, 134 insertions(+), 1 deletion(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2015-07-30 16:39 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-07-30 16:39 pgsql: Use appropriate command type when retrieving relation's policies Joe Conway <mail@joeconway.com>
2015-07-30 16:39 pgsql: Use appropriate command type when retrieving relation's policies Joe Conway <mail@joeconway.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox