Re: Review of Row Level Security - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: Review of Row Level Security
Date
Msg-id 20121221165109.144640@gmx.com
Whole thread Raw
In response to Review of Row Level Security  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: Review of Row Level Security  (Kohei KaiGai <kaigai@kaigai.gr.jp>)
Re: Review of Row Level Security  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers
Simon Riggs wrote:

> Each table has a single security clause. The clause doesn't enforce
> that it must contain something that depends on role, but that is the
> most easily understood usage of it. We do that to ensure that you can
> embed the intelligence into a function, say hasRowLevelAccess(), which
> doesn't have any provable relationship on role, and maybe wouldn't do
> anything in unit test, yet clearly in production it would do so.
> 
> It would be easy enough to include read/write variable clauses by
> using a function similar to TG_OP for triggers, e.g. StatementType.
> That would make the security clause that applied only to reads into
> something like this (StatementType('INSERT, UPDATE') OR other-quals).

In the case where the logic in encapsulated into a function, what
are the logical differences from a BEFORE EACH ROW trigger? If
none, and this is strictly an optimization, what are the benchmarks
showing?

-Kevin



pgsql-hackers by date:

Previous
From: Joel Jacobson
Date:
Subject: Re: PL/PgSQL STRICT
Next
From: Tom Lane
Date:
Subject: Re: PL/PgSQL STRICT