Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1guGAB-0001tw-Vg for pgsql-admin@arkaria.postgresql.org; Thu, 14 Feb 2019 12:30:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1guGAA-0001B6-HA for pgsql-admin@arkaria.postgresql.org; Thu, 14 Feb 2019 12:30:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1guGAA-0001Aw-5M for pgsql-admin@lists.postgresql.org; Thu, 14 Feb 2019 12:30:46 +0000 Received: from mx2.mailbox.org ([80.241.60.215]) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1guGA6-0005fF-MN for pgsql-admin@lists.postgresql.org; Thu, 14 Feb 2019 12:30:44 +0000 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 3E2AEA1792; Thu, 14 Feb 2019 13:30:38 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter04.heinlein-hosting.de (spamfilter04.heinlein-hosting.de [80.241.56.122]) (amavisd-new, port 10030) with ESMTP id F5_h1881qZVe; Thu, 14 Feb 2019 13:30:33 +0100 (CET) Message-ID: <391a608c085a9b3ba28dcea6ff891c185df1cbcf.camel@cybertec.at> Subject: Re: Rename or Removing Postgres user From: Laurenz Albe To: Devendra Yadav , pgsql-admin@lists.postgresql.org Date: Thu, 14 Feb 2019 13:30:32 +0100 In-Reply-To: References: Organization: Cybertec Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Devendra Yadav wrote: > I want to know if I rename 'postgres' user to 'someuser' retaining it's privileges i.e superuser and other privileges. > > Or what if I drop the 'postgres' user and create a new superuser. I tried dropping Postgres user but it says "cannot drop role postgres because it is required by the database system". > > So my concern is what happens if I rename it. As far as I can check there's no impact, but in case anyone has faced issues regarding this, please suggest. You can rename the user without any problems. Internally, only the object ID of the role is used, the name is just an entry in "pg_authid". Resources outside the database proper, for example configuration files like "pg_hba.conf", will have to be adapted. You cannot drop the "postgres" user, however. You say further downthread that you want to do this for security reasons. Keep in mind that this is the lowest form of security: "security by obscurity". For better security, make sure that the superuser can only log in from the database machine itself, and that only administrators get shell access there. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com