Re: [HACKERS] [PATCH] Lockable views

Поиск
Список
Период
Сортировка
От Yugo Nagata
Тема Re: [HACKERS] [PATCH] Lockable views
Дата
Msg-id 20180416174116.80818393.nagata@sraoss.co.jp
обсуждение исходный текст
Ответ на Re: [HACKERS] [PATCH] Lockable views  (Tatsuo Ishii <ishii@sraoss.co.jp>)
Список pgsql-hackers
On Thu, 05 Apr 2018 07:53:42 +0900 (JST)
Tatsuo Ishii <ishii@sraoss.co.jp> wrote:

I update the patch to fix the lockable view issues.

> >> > > +typedef struct
> >> > > +{
> >> > > +    Oid root_reloid;
> >> > > +    LOCKMODE lockmode;
> >> > > +    bool nowait;
> >> > > +    Oid viewowner;
> >> > > +    Oid viewoid;
> >> > > +} LockViewRecurse_context;
> >> > 
> >> > Probably wouldn't hurt to pgindent the larger changes in the patch.
> 
> Yeah. Also, each struct member needs a comment.

I applied pgindent and added comments to struct members.

> 
> >> > Hm, how can that happen? And if it can happen, why can it only happen
> >> > with the root relation?
> >> 
> >> For example, the following queries cause the infinite recursion of views. 
> >> This is detected and the error is raised.
> >> 
> >>  create table t (i int);
> >>  create view v1 as select 1;
> >>  create view v2 as select * from v1;
> >>  create or replace view v1 as select * from v2;
> >>  begin;
> >>  lock v1;
> >>  abort;
> >> 
> >> However, I found that the previous patch could not handle the following
> >> situation in which the root relation itself doesn't have infinite recursion.
> >> 
> >>  create view v3 as select * from v1;
> >>  begin;
> >>  lock v3;
> >>  abort;
> 
> Shouldn't they be in the regression test?

Added tests for the infinite recursion detection.

Regards,

> 
> It's shame that create_view test does not include the cases, but it's
> another story.
> 
> Best regards,
> --
> Tatsuo Ishii
> SRA OSS, Inc. Japan
> English: http://www.sraoss.co.jp/index_en.php
> Japanese:http://www.sraoss.co.jp


-- 
Yugo Nagata <nagata@sraoss.co.jp>

Вложения

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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: auto_explain and parallel queries issue
Следующее
От: Amit Langote
Дата:
Сообщение: Re: ON CONFLICT DO UPDATE for partitioned tables