Re: [HACKERS] [PATCH] Lockable views

From: Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>
To: nagata(at)sraoss(dot)co(dot)jp
Cc: andres(at)anarazel(dot)de, ishii(at)sraoss(dot)co(dot)jp, robertmhaas(at)gmail(dot)com, thomas(dot)munro(at)enterprisedb(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] [PATCH] Lockable views
Date: 2018-04-04 22:53:42
Message-ID: 20180405.075342.1617087266053913015.t-ishii@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>> > > +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.

>> > 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?

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2018-04-04 23:43:44 Re: [PATCH] btree_gin, add support for uuid, bool, name, bpchar and anyrange types
Previous Message legrand legrand 2018-04-04 22:43:52 Re: [PROPOSAL] timestamp informations to pg_stat_statements