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 1euRiU-0001CY-TH for pgsql-general@arkaria.postgresql.org; Fri, 09 Mar 2018 23:46:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1euRiT-0008Fn-8U for pgsql-general@arkaria.postgresql.org; Fri, 09 Mar 2018 23:46:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1euRiT-0008Fd-0c for pgsql-general@lists.postgresql.org; Fri, 09 Mar 2018 23:46:25 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1euRiP-0002T2-Pj for pgsql-general@lists.postgresql.org; Fri, 09 Mar 2018 23:46:24 +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 w29NkFsW027666; Fri, 9 Mar 2018 18:46:15 -0500 From: Tom Lane To: Ron Johnson cc: pgsql-general@lists.postgresql.org Subject: Re: Ability to create tables In-reply-to: <2b6740bf-cab4-6ddf-2928-665d632efb41@cox.net> References: <2b6740bf-cab4-6ddf-2928-665d632efb41@cox.net> Comments: In-reply-to Ron Johnson message dated "Fri, 09 Mar 2018 17:13:48 -0600" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <27664.1520639175.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 09 Mar 2018 18:46:15 -0500 Message-ID: <27665.1520639175@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Ron Johnson writes: > Even though I revoked the=C2=A0 CREATE priv on role ABCREADONLY, it's st= ill able = > to create tables.=C2=A0 What can I do to prevent this? > $ psql -c 'revoke create on database "ABC123" from "ABCREADONLY";' That revokes the ability to create new schemas within that database (which I suspect the role did not have anyway). What you need is to remove its ability to create objects within the public schema within that database. By default, that ability is granted to PUBLIC, so that "revoke create on schema public from "ABCREADONLY";" won't help either. What you have to do is "revoke create on schema public from public", and then grant it back to just the roles that should have it. If you don't want the role creating temp tables either, you need to revoke its TEMP right on the database (which *is* a database-level privilege). Again, this'll involve disallowing that to PUBLIC, since that default grant is how it's getting the privilege. regards, tom lane