From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Marc Munro <marc@bloodnok.com>
To: pgsql-general@postgresql.org
Subject: Re: policies and extensions
Date: Mon, 17 Feb 2020 19:28:25 -0800
Message-ID: <42b2e01b-8afd-1a3f-be1f-b221d1bae3da@aklaver.com> (raw)
In-Reply-To: <1581979568.18009.18.camel@bloodnok.com>
References: <1581979568.18009.18.camel@bloodnok.com>
On 2/17/20 2:46 PM, Marc Munro wrote:
> I tried to define a policy within an extension but the policy does not
> seem to belong to the extension. Is this the way it is supposed to be?
>
> This is postgres 9.5.21
>
> Here is the relevant code from the extension:
>
> create table rls2 (
> username text not null,
> details text not null
> );
>
> create policy only_owner on rls2
> for all
> to session_user
> using (username = user);
>
> The table, as expected, depends on the extension but the policy does
> not (determined by querying pg_depend).
>
> Am I missing something special about policies or is this an oversight?
?:
https://www.postgresql.org/docs/9.5/sql-createpolicy.html
"The CREATE POLICY command defines a new row-level security policy for a
table. Note that row-level security must be enabled on the table (using
ALTER TABLE ... ENABLE ROW LEVEL SECURITY) in order for created policies
to be applied."
>
> __
> Marc
>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
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-general@postgresql.org
Cc: adrian.klaver@aklaver.com, marc@bloodnok.com
Subject: Re: policies and extensions
In-Reply-To: <42b2e01b-8afd-1a3f-be1f-b221d1bae3da@aklaver.com>
References: <1581979568.18009.18.camel@bloodnok.com> <42b2e01b-8afd-1a3f-be1f-b221d1bae3da@aklaver.com>
* 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