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 1kSrk3-0000PH-JF for pgsql-bugs@arkaria.postgresql.org; Thu, 15 Oct 2020 01:07:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kSrk1-0000Z2-Nk for pgsql-bugs@arkaria.postgresql.org; Thu, 15 Oct 2020 01:07:37 +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 1kSrk1-0000Yv-HW for pgsql-bugs@lists.postgresql.org; Thu, 15 Oct 2020 01:07:37 +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 1kSrjz-0003Lp-IL for pgsql-bugs@lists.postgresql.org; Thu, 15 Oct 2020 01:07:36 +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 09F17VlG3643197; Wed, 14 Oct 2020 21:07:33 -0400 From: Tom Lane To: "akada shigeki" cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16672: Postgres user passwords are corrupted during migration In-reply-to: <000101d6a28c$e4fdfca0$aef9f5e0$@asahi-net.or.jp> References: <16672-cdf02792fc851417@postgresql.org> <3640830.1602720588@sss.pgh.pa.us> <000101d6a28c$e4fdfca0$aef9f5e0$@asahi-net.or.jp> Comments: In-reply-to "akada shigeki" message dated "Thu, 15 Oct 2020 09:48:26 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3643195.1602724051.1@sss.pgh.pa.us> Date: Wed, 14 Oct 2020 21:07:31 -0400 Message-ID: <3643196.1602724051@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk "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. regards, tom lane