Re: RLS policy issue - Mailing list pgsql-general

From Stephen Frost
Subject Re: RLS policy issue
Date
Msg-id 20150521223453.GB26667@tamriel.snowman.net
Whole thread Raw
In response to RLS policy issue  (Ted Toth <txtoth@gmail.com>)
List pgsql-general
Ted,

* Ted Toth (txtoth@gmail.com) wrote:
> I'd also expect that the "rewrite" would have added the POLICY SELECT
> USING clause to the query but I don't see any indication of that in
> the details that follow:

Just running 'explain' should show the policy.

Are you running this as the owner of the table or as a superuser?  As
noted in the documentation, the owner (who controls the policies
on the table anyway) and the superuser (who can bypass all
authorization) do not have the RLS policies applied unless the
'row_security' GUC is set to 'force', like so:

SET row_security = force;

By the way, you might be interested in the test_rls_hooks module which I
wrote and committed recently under src/test/modules.  That's the
approach which I was thinking about using with sepgsql to provide policy
enforcement, but using regular policies should also work.

    Thanks!

        Stephen

Attachment

pgsql-general by date:

Previous
From: Ted Toth
Date:
Subject: RLS policy issue
Next
From: Ian Barwick
Date:
Subject: Re: Enum in foreign table: error and correct way to handle.