Re: [GENERAL] column-level update privs + lock table

From: KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Josh Kupershmidt <schmiddy(at)gmail(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [GENERAL] column-level update privs + lock table
Date: 2010-11-29 03:10:26
Message-ID: 4CF319A2.6040005@ak.jp.nec.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

(2010/11/29 10:43), Robert Haas wrote:
> 2010/11/28 KaiGai Kohei<kaigai(at)ak(dot)jp(dot)nec(dot)com>:
>>> I'm not totally convinced that this is the correct behavior. It seems
>>> a bit surprising that UPDATE privilege on a single column is enough to
>>> lock out all SELECT activity from the table. It's actually a bit
>>> surprising that even full-table UPDATE privileges are enough to do
>>> this, but this change would allow people to block access to data they
>>> can neither see nor modify. That seems counterintuitive, if not a
>>> security hole.
>>>
>> In my understanding, UPDATE privilege on a single column also allows
>> lock out concurrent updating even if this query tries to update rows
>> partially.
>> Therefore, the current code considers UPDATE privilege on a single
>> column is enough to lock out the table. Right?
>
> Against concurrent updates and deletes, yes. Against inserts that
> don't involve potential unique-index conflicts, and against selects,
> no.
>
>> My comment was from a standpoint which wants consistent behavior
>> between SELECT ... FOR and LOCK command.
>
> Again, nothing about this makes those consistent.
>
>> If we concerned about this
>> behavior, ExecCheckRTEPerms() might be a place where we also should fix.
>
> I don't understand what you're getting at here.
>
I thought the author concerned about inconsistency between them.
(Perhaps, I might misunderstood his motivation?)

What was the purpose that this patch tries to solve?
In the first message of this topic, he concerned as follows:

> I noticed that granting a user column-level update privileges doesn't
> allow that user to issue LOCK TABLE with any mode other than Access
> Share.

Do we need to answer: "Yes, it is a specification, so you need to grant
table level privileges, instead"?

Thanks
--
KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Elliot Chance 2010-11-29 04:31:33 Re: Postgres forums ... take 2
Previous Message Scott Marlowe 2010-11-29 01:54:14 Re: ERROR: xlog flush request 17/4D6C2720 is not satisfied

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-11-29 04:51:43 Re: profiling connection overhead
Previous Message Robert Haas 2010-11-29 01:47:09 Re: contrib: auth_delay module