Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pcTjp-0004mT-1k for pgsql-general@arkaria.postgresql.org; Wed, 15 Mar 2023 16:12:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pcTjn-0001WH-VS for pgsql-general@arkaria.postgresql.org; Wed, 15 Mar 2023 16:12:27 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pcTjn-0001Sv-JG for pgsql-general@lists.postgresql.org; Wed, 15 Mar 2023 16:12:27 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pcTjl-0007Jp-DF for pgsql-general@lists.postgresql.org; Wed, 15 Mar 2023 16:12:26 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 32FGCNVp3339368; Wed, 15 Mar 2023 12:12:23 -0400 From: Tom Lane To: Raivo Rebane cc: pgsql-general@lists.postgresql.org Subject: Re: How to behive if I remove password from postgres role In-reply-to: References: Comments: In-reply-to Raivo Rebane message dated "Wed, 15 Mar 2023 18:02:09 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3339366.1678896743.1@sss.pgh.pa.us> Date: Wed, 15 Mar 2023 12:12:23 -0400 Message-ID: <3339367.1678896743@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Raivo Rebane writes: > Then I altered role of postgres so, that password = NULL. > Now I am in situation that I can't run any postgres command. > What I must to do ? Stop the server, start it in single-user mode (postgres --single), issue an ALTER USER command to undo the damage. Or modify pg_hba.conf to let you in without a password. Local peer auth, for example, is perfectly secure. regards, tom lane