Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1emiEv-0004Yq-W9 for pgsql-general@arkaria.postgresql.org; Fri, 16 Feb 2018 15:47:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1emiEu-0003z4-JP for pgsql-general@arkaria.postgresql.org; Fri, 16 Feb 2018 15:47:56 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1emiEu-0003yu-8K for pgsql-general@lists.postgresql.org; Fri, 16 Feb 2018 15:47:56 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1emiEr-0004Nj-C6 for pgsql-general@postgresql.org; Fri, 16 Feb 2018 15:47:55 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w1GFlpOb015453; Fri, 16 Feb 2018 10:47:51 -0500 From: Tom Lane To: Stephen Frost cc: "David G. Johnston" , Durumdara , Charles Clavadetscher , Postgres General Subject: Re: Remove default privilege from DB In-reply-to: <20180216153528.GI2416@tamriel.snowman.net> References: <09ca01d3a3e0$685ca460$3915ed20$@swisspug.org> <0f5a01d3a65f$a0a38010$e1ea8030$@swisspug.org> <20180216153528.GI2416@tamriel.snowman.net> Comments: In-reply-to Stephen Frost message dated "Fri, 16 Feb 2018 10:35:28 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <15451.1518796071.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 16 Feb 2018 10:47:51 -0500 Message-ID: <15452.1518796071@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Stephen Frost writes: > * David G. Johnston (david.g.johnston@gmail.com) wrote: >> =E2=80=8BNot sure if this is what you mean but there is no concept of "= negative >> state" in the permissions system. Everything starts out with no >> permissions. Grant adds permissions and revoke un-adds granted >> permissions.=E2=80=8B Revoking something that doesn't exist is either = a no-op or a >> warning depending on the context - either way its doesn't setup a >> "forbidden" state for the permission. > This isn't entirely correct. Functions are the classic example where > EXECUTE to PUBLIC is part of the default and the "negative" state of > having a function where EXECUTE is REVOKE'd from PUBLIC is entirely > reasonable and even common. FWIW, I thought David's description was fine. The fact that the initial state of an object typically includes some positive grants doesn't change the fact that there's no such thing as a negative grant. In particular, if there is a GRANT TO PUBLIC, no amount of revoking that privilege from individual users will have any effect, because the public grant is still there. regards, tom lane