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 1gKMdp-0005wg-Vh for pgsql-admin@arkaria.postgresql.org; Wed, 07 Nov 2018 12:09:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gKMdo-0000pu-AA for pgsql-admin@arkaria.postgresql.org; Wed, 07 Nov 2018 12:09:00 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gKMdn-0000mG-VU for pgsql-admin@lists.postgresql.org; Wed, 07 Nov 2018 12:09:00 +0000 Received: from mtaout004-public.msg.strl.va.charter.net ([68.114.190.29]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gKMdk-0007L3-VH for pgsql-admin@postgresql.org; Wed, 07 Nov 2018 12:08:58 +0000 Received: from impout006 ([68.114.189.21]) by mtaout004.msg.strl.va.charter.net (InterMail vM.9.00.023.01 201-2473-194) with ESMTP id <20181107120855.BKFR3685.mtaout004.msg.strl.va.charter.net@impout006>; Wed, 7 Nov 2018 06:08:55 -0600 Received: from cerberus.crazybean.net ([24.151.10.150]) by impout006 with charter.net id x08t1y0023EE3TL0108tLW; Wed, 07 Nov 2018 06:08:55 -0600 X-Authority-Analysis: v=2.2 cv=D8w3ErZj c=1 sm=1 tr=0 a=D2HTw/M6/8MmcHighGO7rg==:117 a=D2HTw/M6/8MmcHighGO7rg==:17 a=IkcTkHD0fZMA:10 a=xqWC_Br6kY4A:10 a=JHtHm7312UAA:10 a=pGLkceISAAAA:8 a=6HehyyvcTJQyGtzuiPAA:9 a=QEXdDO2ut3YA:10 Received: from [IPv6:2001:470:e117:4:ace3:4210:bf0d:be3c] (2001:470:e117:4:ace3:4210:bf0d:be3c [IPv6:2001:470:e117:4:ace3:4210:bf0d:be3c]) by cerberus.crazybean.net (OpenSMTPD) with ESMTPSA id d0e7aad0 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Wed, 7 Nov 2018 07:08:52 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.1 \(3445.100.42\)) Subject: Re: How to revoke "Create Privilege" from a readonly user in postgres? From: Rui DeSousa In-Reply-To: <1541574536956-0.post@n3.nabble.com> Date: Wed, 7 Nov 2018 07:08:52 -0500 Cc: pgsql-admin@postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <1541419964128-0.post@n3.nabble.com> <1541569945694-0.post@n3.nabble.com> <2A936B5B-CF6A-41E5-B839-E6CE7EDB8CF7@crazybean.net> <1541574536956-0.post@n3.nabble.com> To: pavan95 X-Mailer: Apple Mail (2.3445.100.42) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk First I don=E2=80=99t know what I was thinking=E2=80=A6 I think this = only change the default for the current use=E2=80=A6 not all users; I = just never use this form. alter default privileges in schema readonly grant select on tables to = readonly; > On Nov 7, 2018, at 2:08 AM, pavan95 = wrote: >=20 > Rui, >=20 > Thanks for responding. I'm perfectly alright with this approach. But = can we > do the same in "PUBLIC" schema?? >=20 Yeah; but why I think it already defaults to that; like I said before = you should drop the public schema and not use it. The other option is to revoke from the public role on the public schema. I normally create a schema owner user that owns the objects and is only = use for creating objects. Then I alter it default privileges to grant = what ever access the application needs and other user role needs, etc. = It=E2=80=99s always better to be granular if you development model = supports it instead of sweeping rules.=