Re: [COMMITTERS] pgsql: Row-Level Security Policies (RLS)

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [COMMITTERS] pgsql: Row-Level Security Policies (RLS)
Date: 2015-05-26 13:08:00
Message-ID: 20150526130800.GA26667@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Alvaro,

* Alvaro Herrera (alvherre(at)2ndquadrant(dot)com) wrote:
> What do we need RowSecurityPolicy->policy_id for? It seems to me that
> it is only used to determine whether the policy is the "default deny"
> one, so that it can later be removed if a hook adds a different one.
> This seems contrived as well as under-documented. Why isn't a boolean
> flag sufficient?

Thanks for taking a look!

It's also used during relcache updates (see equalPolicy()). That wasn't
originally the case (I had missed adding the necessary bits to relcache
in the original patch), but I wouldn't want to remove that piece now
and, given that it's there, using InvalidOid to indicate when it's the
default-deny policy (and therefore this is no actual Oid) seems
sensible.

Thanks again!

Stephen

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2015-05-26 14:44:06 Re: [COMMITTERS] pgsql: Row-Level Security Policies (RLS)
Previous Message Tom Lane 2015-05-26 01:56:22 pgsql: Fix valgrind's "unaddressable bytes" whining about BRIN code.

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-05-26 14:22:48 Re: Order of columns in query is important?!
Previous Message Andrew Dunstan 2015-05-26 12:55:20 Re: PostgreSQL 8.3 index page count clarification