Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 4D72B632A08 for ; Sat, 18 Apr 2009 03:36: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 01240-04 for ; Sat, 18 Apr 2009 03:36:03 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og105.obsmtp.com (exprod7og105.obsmtp.com [64.18.2.163]) by mail.postgresql.org (Postfix) with SMTP id 738216327F1 for ; Sat, 18 Apr 2009 03:36:05 -0300 (ADT) Received: from source ([209.85.218.159]) by exprod7ob105.postini.com ([64.18.6.12]) with SMTP ID DSNKSel00wAp1GP4BRs6t79qtKc+NWu7YrGO@postini.com; Fri, 17 Apr 2009 23:36:05 PDT Received: by bwz3 with SMTP id 3so1329668bwz.6 for ; Fri, 17 Apr 2009 23:36:02 -0700 (PDT) Received: by 10.103.24.11 with SMTP id b11mr1856167muj.58.1240036562800; Fri, 17 Apr 2009 23:36:02 -0700 (PDT) Received: from ?85.77.217.31? (YMYDXXX.gprs.sl-laajakaista.fi [85.77.217.31]) by mx.google.com with ESMTPS id j2sm7856880mue.49.2009.04.17.23.35.58 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 17 Apr 2009 23:36:02 -0700 (PDT) Message-ID: <49E974AD.3020602@enterprisedb.com> Date: Sat, 18 Apr 2009 09:35:25 +0300 From: Heikki Linnakangas Organization: EnterpriseDB User-Agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: KaiGai Kohei CC: Tom Lane , KaiGai Kohei , pgsql-hackers@postgresql.org Subject: Re: [PATCH] unalias of ACL_SELECT_FOR_UPDATE References: <49E809F6.8070008@ak.jp.nec.com> <49E8133A.7090601@enterprisedb.com> <49E81EA1.2060202@ak.jp.nec.com> <20069.1239977115@sss.pgh.pa.us> <49E91AE4.9020404@kaigai.gr.jp> In-Reply-To: <49E91AE4.9020404@kaigai.gr.jp> Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200904/961 X-Sequence-Number: 137064 KaiGai Kohei wrote: > 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.) That's even more useless, since you need ACL_SELECT for SELECT FOR SHARE anyway. > 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. It checks ACL_SELECT for *Access*ShareLock. SELECT FOR SHARE acquires a RowShareLock. So the equivalent of "SELECT * FROM foo FOR SHARE" using LOCK is "LOCK TABLE foo RowShareLock", which checks ACL_UPDATE|ACL_DELETE|ACL_TRUNCATE. IMHO the only sane change would be to introduce a new ACL_SELECT_FOR_SHARE permission for SELECT FOR SHARE. That way you could grant SELECT_FOR_SHARE permission on a table to let people insert rows into other tables that have a foreign key reference to it, without having to grant UPDATE permission. Does the SQL spec have anything to say about this, BTW? -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com