Re: policies and extensions

Поиск
Список
Период
Сортировка
От Marc Munro
Тема Re: policies and extensions
Дата
Msg-id 1582044786.18009.20.camel@bloodnok.com
обсуждение исходный текст
Ответ на Re: policies and extensions  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
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



В списке pgsql-general по дате отправления:

Предыдущее
От: Ranjan Gajare
Дата:
Сообщение: Logical Replication ERROR reporting issue
Следующее
От: Tom Lane
Дата:
Сообщение: Re: policies and extensions