Re: [PATCH] Lockable views

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Lockable views
Date: 2017-10-27 05:11:14
Message-ID: CA+Tgmoa2ywTctLxnzq4QPpJQeAuGCSam6Y4Q52vFEbcf2KvF4Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Oct 11, 2017 at 11:36 AM, Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp> wrote:
> In the attached patch, only automatically-updatable views that do not have
> INSTEAD OF rules or INSTEAD OF triggers are lockable. It is assumed that
> those views definition have only one base-relation. When an auto-updatable
> view is locked, its base relation is also locked. If the base relation is a
> view again, base relations are processed recursively. For locking a view,
> the view owner have to have he priviledge to lock the base relation.

Why is this the right behavior?

I would have expected LOCK TABLE v to lock the view and nothing else.

See http://postgr.es/m/AANLkTi=KupesJHRdEvGfbT30aU_iYRO6zwK+fwwY_sGd@mail.gmail.com
for previous discussion of this topic.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-10-27 05:20:32 Re: WIP: BRIN bloom indexes
Previous Message Pavel Stehule 2017-10-27 05:08:43 Re: proposal: schema variables