pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marc Munro <marc@bloodnok.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-general@postgresql.org
Subject: Re: policies and extensions
Date: Tue, 18 Feb 2020 08:53:06 -0800
Message-ID: <1582044786.18009.20.camel@bloodnok.com> (raw)
In-Reply-To: <679.1581997707@sss.pgh.pa.us>
References: <1581979568.18009.18.camel@bloodnok.com>
	<679.1581997707@sss.pgh.pa.us>

On Mon, 2020-02-17 at 22:48 -0500, Tom Lane wrote:
> Marc Munro <marc@bloodnok.com> writes:
> > 
> An RLS policy is a table "subsidiary object" so it only depends
> indirectly
> on the extension that owns the table.

Yep, I get that, and I see the dependency chain in the catalog. 

However an extension can create the table with or without the policy,
and a table created by an extension without policy can later have a
policy added, and, unless I'm missing something, the same dependency
chain exists in either case.

This means that I cannot tell whether the policy was added by the
extension or not.

I can see use cases where an extension writer might create an extension
with policies on tables, and others where a user might want to create
policies on tables from an extension provided by someone else.

Unfortunately, there is no way after the fact of determining which case
applies.

My use case is a tool that determines the state of a database for
performing diffs, etc.  It can generate ddl from database diffs to
create or alter tables, etc, and can also deal with policies and
extensions but will not be able to deal with policies created in
extensions, which is disappointing.

I can live with it though.  I'll document it as an oddity that the tool
is unable to deal with and generate commented ddl if the policy applies
to a table defined in an extension.

Thanks for the response.

__
Marc





view thread (7+ messages)  latest in thread

Message-ID: <1582044786.18009.20.camel@bloodnok.com>
Permalink:  ../1582044786.18009.20.camel@bloodnok.com/
Also on:    postgresql.org/message-id/1582044786.18009.20.camel@bloodnok.com

 · 

reply

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: marc@bloodnok.com, tgl@sss.pgh.pa.us
  Subject: Re: policies and extensions
  In-Reply-To: <1582044786.18009.20.camel@bloodnok.com>
  References: <1581979568.18009.18.camel@bloodnok.com> <679.1581997707@sss.pgh.pa.us> <1582044786.18009.20.camel@bloodnok.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