From: Joe Conway <mail@joeconway.com>
To: pgsql-committers@postgresql.org
Subject: pgsql: Use appropriate command type when retrieving relation's policies
Date: Thu, 30 Jul 2015 16:39:06 +0000
Message-ID: <E1ZKqrK-0006oz-Ub@gemulon.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: mail@joeconway.com
Subject: Re: pgsql: Use appropriate command type when retrieving relation's policies
In-Reply-To: <E1ZKqrK-0006oz-Ub@gemulon.postgresql.org>
References: <E1ZKqrK-0006oz-Ub@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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