Re: [HACKERS] [PATCH] Lockable views

From: Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>
To: Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] [PATCH] Lockable views
Date: 2017-12-27 14:31:54
Message-ID: 20171227233154.c84c2ede.nagata@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Attached is the updated patch.

On Mon, 16 Oct 2017 10:07:48 +0900 (JST)
Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp> wrote:
> >> > It would be nice if the message would be something like:
> >> >
> >> > DETAIL: Views that return aggregate functions are not lockable

> You could add a flag to view_query_is_auto_updatable() to switch the
> message between
>
> DETAIL: Views that return aggregate functions are not automatically updatable.
>
> and
>
> DETAIL: Views that return aggregate functions are not lockable

I didn't want to change the interface of view_query_is_auto_updatable()
because this might be called from other third-patry software, so I renamed
this function to view_query_is_auto_updatable_or_lockable() and added the flag
to this. I created view_query_is_auto_updatable() as a wrapper of this function.
I also made view_query_is_lockable() that returns a other message than
view_query_is_auto_updatable().

> On Tue, 17 Oct 2017 11:59:05 +0900 (JST)
> Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp> wrote:
> > 1) Leave as it is (ignore tables appearing in a subquery)
> >
> > 2) Lock all tables including in a subquery
> >
> > 3) Check subquery in the view

> > So it seem #1 is the most reasonable way to deal with the problem
> > assuming that it's user's responsibility to take appropriate locks on
> > the tables in the subquery.

I adopted #1 and I didn't change anything about this.

Regards,

--
Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>

Attachment Content-Type Size
lock_view-v2.patch text/x-diff 18.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Vik Fearing 2017-12-27 15:03:59 Re: TupleDescCopy doesn't clear atthasdef, attnotnull, attidentity
Previous Message PostgreSQL - Hans-Jürgen Schönig 2017-12-27 14:14:36 Re: AS OF queries