Skip site navigation (1) Skip section navigation (2)

WIP patch for updatable security barrier views

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: WIP patch for updatable security barrier views
Date: 2013-11-21 13:15:28
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Hi all

I have updatable security barrier views working for INSERT and DELETE,
so this might be a good chance to see whether the described approach is
acceptable in reality, not just in theory.

I've been surprised by how well it worked out. I actually landed up
removing a lot of the existing updatable views code; once update knows
how to operate on a subquery it becomes unnecessary to duplicate the
optimiser's knowledge of how to expand and flatten a view in the rewriter.

INSERT and DELETE work. I haven't tested INSERT with defaults on the
base rel yet but suspect it'll need the same support as for update.

UPDATE isn't yet supported because of the need to inject references to
cols in the base rel that aren't selected in the view.
expand_targetlist(...) in prep/preptlist.c already does most of this
work so I hope to be able to use or adapt that.

This patch isn't subject to the replanning and invalidation issues
discussed for RLS because updatable s.b. views don't depend on the
current user or some special "bypass RLS" right like RLS would.

The regression tests die because they try to update an updatable view.

This isn't proposed for inclusion as it stands, it's a chance to comment
and say "why the heck would you do that".

 Craig Ringer         
 PostgreSQL Development, 24x7 Support, Training & Services

Attachment: 0001-First-pass-updatable-s.b.-views-support-only-handles.patch
Description: text/x-patch (17.5 KB)


pgsql-hackers by date

Next:From: Robert HaasDate: 2013-11-21 13:22:05
Subject: Re: Replication Node Identifiers and crashsafe Apply Progress
Previous:From: Robert HaasDate: 2013-11-21 13:06:07
Subject: Re: [PATCH] Store Extension Options

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group