Re: Commitfest 2021-11 Patch Triage - Part 1

Поиск
Список
Период
Сортировка
От Yugo NAGATA
Тема Re: Commitfest 2021-11 Patch Triage - Part 1
Дата
Msg-id 20211203155222.60013e97ae635ef5c66fda39@sraoss.co.jp
обсуждение исходный текст
Ответ на Re: Commitfest 2021-11 Patch Triage - Part 1  (Marcos Pegoraro <marcos@f10.com.br>)
Список pgsql-hackers
On Wed, 1 Dec 2021 09:14:31 -0300
Marcos Pegoraro <marcos@f10.com.br> wrote:

> >
> > I think the reason why we can't update a materialized view directly is
> > because
> > it is basically a "view" and it should not contains any data irrelevant to
> > its
> > definition and underlying tables. If we would have a feature to update a
> > materialized view direcly,  maybe, it should behave as updatable-view as
> > well
> > as normal (virtual) views, although I am not sure....
> >
> 
> Well, I didn´t find any place where is detailed why those tables are not
> updatable.
> And would be fine to be updated through triggers or cron jobs until IVM is
> available.
> CheckValidRowMarkRel just gives an exception "cannot lock rows in
> materialized view ...", but why ?
> What are the differences between Materialized Views and tables ?

It would be that materialized views are related to its definition query
and expected to have contents that is consistent with it,  at least at some
point in time, I think.

In order to allow triggers to update materialized views, we'd need to
make OpenMatViewIncrementalMaintenance and CloseMatViewIncrementalMaintenance
public since there are static functions in matview.c. However, there is a
concern that it will make the contents of a materialized view completely
unreliable [1]. Therefore, if we do it, we would need privilege management
in some way.

[1]
https://www.postgresql.org/message-id/flat/CACjxUsP8J6bA4RKxbmwujTVMwMZrgR3AZ7yP5F2XkB-f9w7K7Q%40mail.gmail.com#efbee336d7651ce39bc5ff9574f92002

Regards,
Yugo Nagata
-- 
Yugo NAGATA <nagata@sraoss.co.jp>



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

Предыдущее
От: Masahiko Sawada
Дата:
Сообщение: Re: Skipping logical replication transactions on subscriber side
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Use simplehash.h instead of dynahash in SMgr