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 1eqEBI-0003V8-Qc for pgsql-admin@arkaria.postgresql.org; Mon, 26 Feb 2018 08:30:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eqEBH-0008J4-E1 for pgsql-admin@arkaria.postgresql.org; Mon, 26 Feb 2018 08:30:43 +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 1eqEBH-0008Iu-3Z for pgsql-admin@lists.postgresql.org; Mon, 26 Feb 2018 08:30:43 +0000 Received: from mx1.mailbox.org ([80.241.60.212]) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eqEB9-0000Oc-En for pgsql-admin@postgresql.org; Mon, 26 Feb 2018 08:30:41 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id 459F342B61; Mon, 26 Feb 2018 09:30:31 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de [80.241.56.117]) (amavisd-new, port 10030) with ESMTP id PmMMCTLGRUJA; Mon, 26 Feb 2018 09:30:29 +0100 (CET) Message-ID: <1519633827.2714.6.camel@cybertec.at> Subject: Re: how do i change the password for 'postgres' user From: Laurenz Albe To: Gopi G , Francis Santiago Cc: Pgsql-admin Date: Mon, 26 Feb 2018 09:30:27 +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 Gopi G wrote: > On Sat, Feb 24, 2018 at 6:48 AM, Francis Santiago wrote: > > > you entered as the Postgres user, it seems that not because he says : postgres=> > > > > When you enter with the postgres user, it is: postgres=# > > > > 2018-02-23 20:26 GMT-03:00 Gopi G : > > > I have postgres 9.2 running in AWS EC2 (aws linux) instance. > > > I followed documentation and tried to do > > > postgres=> ALTER USER Postgres WITH PASSWORD 'password'; > > > ERROR: must be superuser to alter replication users > > > > > > > > > surprisingly I am not finding any way to solve this problem. > > > and how do I login using 'postgres' linux os user that is created when I installed postgres 9.2? > > > > > > gopi > > > I did login like postgres. > Here is from my command: > > ~$ sudo -u postgres psql postgres > could not change directory to "/home/ec2-user" > Password: > psql (9.2.24) > Type "help" for help. > > postgres=> Check \du in psql to see if you have any superusers left. If not, you must stop the server and start it in single user mode (postgres --single -D /data/directory dbname). Once you are connected as superuser or in single user mode, give "postgres" its superuser privilege back: ALTER ROLE postgres SUPERUSER; Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com