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 1kT6Or-0008HA-QC for pgsql-bugs@arkaria.postgresql.org; Thu, 15 Oct 2020 16:46:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kT6Oq-0002sc-NP for pgsql-bugs@arkaria.postgresql.org; Thu, 15 Oct 2020 16:46:44 +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 1kT6Oq-0002sV-HN for pgsql-bugs@lists.postgresql.org; Thu, 15 Oct 2020 16:46:44 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kT6Oo-0002M5-5h for pgsql-bugs@lists.postgresql.org; Thu, 15 Oct 2020 16:46:43 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1kT6Ok-0005N5-Pb; Thu, 15 Oct 2020 12:46:38 -0400 Date: Thu, 15 Oct 2020 12:46:38 -0400 From: Bruce Momjian To: Tom Lane Cc: akada shigeki , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16672: Postgres user passwords are corrupted during migration Message-ID: <20201015164638.GE3797@momjian.us> References: <16672-cdf02792fc851417@postgresql.org> <3640830.1602720588@sss.pgh.pa.us> <000101d6a28c$e4fdfca0$aef9f5e0$@asahi-net.or.jp> <3643196.1602724051@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3643196.1602724051@sss.pgh.pa.us> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, Oct 14, 2020 at 09:07:31PM -0400, Tom Lane wrote: > "akada shigeki" writes: > > solved. > > I was able to restore by changing SCRAM-SHA-256 in HBA.Conf to MD5. > > Does this mean that PSQL doesn't support SHA-256 encryption? > > No, it means if you want to use SCRAM authentication then you need the > password that's stored in pg_authid to be hashed with SCRAM. The password > you carried forward from v12 evidently isn't. (Again, look into pg_authid > to confirm that.) > > Do this, in either v12 or v13, to update the password: > > set password_encryption to "scram-sha-256"; > alter user postgres with password 'clear text password here'; > > The system cannot do this for you because there's no way to recover > the cleartext password from the md5 hash. I am surprised we don't get more problem reports about this. -- Bruce Momjian https://momjian.us EnterpriseDB https://enterprisedb.com The usefulness of a cup is in its emptiness, Bruce Lee