Re: [PATCH] unalias of ACL_SELECT_FOR_UPDATE

From: KaiGai Kohei <kaigai(at)kaigai(dot)gr(dot)jp>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] unalias of ACL_SELECT_FOR_UPDATE
Date: 2009-04-18 00:12:20
Message-ID: 49E91AE4.9020404@kaigai.gr.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com> writes:
>> Heikki Linnakangas wrote:
>>> What's the point of doing SELECT FOR UPDATE if you're not actually going
>>> to UPDATE the row? Having separate permissions for SELECT FOR UPDATE and
>>> UPDATE seems useless.
>
>> I wonder why SELECT FOR UPDATE need ACL_UPDATE, although the statement
>> itself does not modify any of the given relation.
>
> Because it blocks competing transactions in exactly the same way as an
> UPDATE does. I agree with Heikki --- there is no apparent value in
> having a separate permission bit for this. Given that AclMode is 3/4ths
> full already, I'm not for inventing new privilege types without a very
> strong use-case.
>
> A separate bit for SELECT FOR SHARE might possibly make sense given the
> strength-of-locking argument. But doing both would eat half of the
> available bits, and bring nearer the day that we need a different
> representation for AclMode.

I would not like to have a discussion how many permission bits will be
necessary in the future, because nobody can say something ensured.

We have an another approach that defines ACL_SELECT_FOR_SHARE as
an alias of ACL_SELECT, and applies it on SELECT FOR SHARE statement.
(Needless to say, the targets are already listed, so it might not necessary
to put a ACL_SELECT_FOR_SHARE bit explicitly.)

In the LOCK statement, it checks ACL_SELECT privilege for shared locks and
discriminate between shared and exclusive locks. It seems to me quite natural.

Thanks,
--
KaiGai Kohei <kaigai(at)kaigai(dot)gr(dot)jp>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message KaiGai Kohei 2009-04-18 00:24:27 Re: [PATCH] SE-PostgreSQL for v8.5 development (r1819)
Previous Message Grzegorz Jaskiewicz 2009-04-17 23:39:41 Re: [GENERAL] Performance of full outer join in 8.3