Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fmfn4-0003Te-4m for pgsql-general@arkaria.postgresql.org; Mon, 06 Aug 2018 13:43:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fmfn2-000505-Aw for pgsql-general@arkaria.postgresql.org; Mon, 06 Aug 2018 13:43:16 +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.89) (envelope-from ) id 1fmfn1-0004zm-Vk; Mon, 06 Aug 2018 13:43:16 +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 1fmfmv-00024N-7k; Mon, 06 Aug 2018 13:43:14 +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 w76Dh64S026931; Mon, 6 Aug 2018 09:43:06 -0400 From: Tom Lane To: Bear Giles cc: bejita0409@yahoo.co.jp, "pgsql-admin@lists.postgresql.org" , "pgsql-general@lists.postgresql.org" Subject: Re: How to revoke privileged from PostgreSQL's superuser In-reply-to: References: <913907.28546.qm@web103014.mail.kks.yahoo.co.jp> Comments: In-reply-to Bear Giles message dated "Mon, 06 Aug 2018 07:22:54 -0600" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <26929.1533562986.1@sss.pgh.pa.us> Date: Mon, 06 Aug 2018 09:43:06 -0400 Message-ID: <26930.1533562986@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Bear Giles writes: > In postgresql the equivalent user is 'postgres'. Nobody should ever be > logged in as that user once you've created the initial user(s). What > postgresql calls a 'superuser' is just a user with a few permissions set by > default. It's easy to grant the same privileges to any user, or drop them > from someone created as a superuser. Well, more to the point, a superuser is somebody with the rolsuper bit set in their pg_authid entry. You can revoke the bootstrap superuser's superuserness if you have a mind to -- see ALTER USER. However, as everyone has pointed out already, this is a bad idea and you will end up undoing it. (Figuring out how to do that without a reinstall is left as penance for insisting on a bad idea. It is possible, and I think even documented.) However: a whole lot of what the bootstrap superuser can do is inherent in being the owner of all the built-in database objects, and that you cannot get rid of. Objects have to be owned by somebody. regards, tom lane