Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 979C3634CFB for ; Fri, 17 Apr 2009 03:16:11 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 91783-07 for ; Fri, 17 Apr 2009 03:16:07 -0300 (ADT) X-Greylist: delayed 01:28:14.737622 by SQLgrey-1.7.6 Received: from tyo201.gate.nec.co.jp (TYO201.gate.nec.co.jp [202.32.8.193]) by mail.postgresql.org (Postfix) with ESMTP id BBEF9633297 for ; Fri, 17 Apr 2009 03:16:09 -0300 (ADT) Received: from mailgate3.nec.co.jp ([10.7.69.160]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id n3H6G2CX022148; Fri, 17 Apr 2009 15:16:02 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id n3H6G2J18847; Fri, 17 Apr 2009 15:16:02 +0900 (JST) Received: from mailsv.linux.bs1.fc.nec.co.jp (mailsv.linux.bs1.fc.nec.co.jp [10.34.125.2]) by mailsv3.nec.co.jp (8.13.8/8.13.4) with ESMTP id n3H6G2tk014532; Fri, 17 Apr 2009 15:16:02 +0900 (JST) Received: from [10.19.71.82] (unknown [10.19.71.82]) by mailsv.linux.bs1.fc.nec.co.jp (Postfix) with ESMTP id E90EEE4821E; Fri, 17 Apr 2009 15:16:01 +0900 (JST) Message-ID: <49E81EA1.2060202@ak.jp.nec.com> Date: Fri, 17 Apr 2009 15:16:01 +0900 From: KaiGai Kohei User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Heikki Linnakangas CC: pgsql-hackers@postgresql.org Subject: Re: [PATCH] unalias of ACL_SELECT_FOR_UPDATE References: <49E809F6.8070008@ak.jp.nec.com> <49E8133A.7090601@enterprisedb.com> In-Reply-To: <49E8133A.7090601@enterprisedb.com> Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200904/922 X-Sequence-Number: 137025 Heikki Linnakangas wrote: > KaiGai Kohei wrote: >> Currently, the ACL_SELECT_FOR_UPDATE privilege is defined as an alias >> of ACL_UPDATE as follows: >> >> at src/include/nodes/parsenodes.h: >> : >> /* Currently, SELECT ... FOR UPDATE/FOR SHARE requires UPDATE privileges */ >> #define ACL_SELECT_FOR_UPDATE ACL_UPDATE >> : >> >> It is unconfortable for us because SE-PostgreSQL have two individual >> permissions for updates (db_table:{update}) and explicit table locks >> (db_table:{lock}), but it unables to discriminate whether the given >> relation is actually used for UPDATE or SELECT FOR UPDATE. > > 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. Indeed, it normally leads UPDATE statements, but I think ACL_UPDATE should be checked on the later phase. > A separate permission for SELECT FOR SHARE makes more sense, though. It is my major concern rather than exclusive locks. The SELECT FOR SHARE statement also requires ACL_SELECT_FOR_UPDATE, although it is a read only operation. It makes us hard to set up a table with foreign-key which refers a primary-key on read-only table, for example. Thanks, -- OSS Platform Development Division, NEC KaiGai Kohei