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 1lmdUE-0005Mw-QC for pgsql-admin@arkaria.postgresql.org; Fri, 28 May 2021 14:29:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lmdUD-0006CC-HL for pgsql-admin@arkaria.postgresql.org; Fri, 28 May 2021 14:29:17 +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 1lmdUD-0006C1-4l for pgsql-admin@lists.postgresql.org; Fri, 28 May 2021 14:29:17 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lmdUA-0005oL-8a for pgsql-admin@postgresql.org; Fri, 28 May 2021 14:29:16 +0000 Received: by mail-wm1-x32e.google.com with SMTP id f6-20020a1c1f060000b0290175ca89f698so4679560wmf.5 for ; Fri, 28 May 2021 07:29:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=ncMHZoHeJ1/R3m//Gxdy4e2AOVai4/MkjcejBydaRcs=; b=aaIe02+QQn285PKorfMEwIBnR0/KZuN+YqICilzfwUi2TZNf9TsU4QyN3A1QXY1BWJ 9jcQzAT2k/j6mNWa9AMd7aOw83fao/StyAIDLAyNL2ri22z7Ok1F/6y/8zAX4IvB8SrZ kO83chP3ANoCKtWyryoF69yuNcgrSm2TEvcbsBkYJb3mkYRKSbb7GS1ZRNodlbnD3MlI 0488KNDhF5wF4Y7MV+Y3JubbrrRhAp4WXN/n5Mbawnc/uGgghheolklSsFfsw4npaRMe 5tMl/703fia976dqg1sHmtVcxIs2yRqzp+Gu1A2iGNpwBsE52MkxKqLHuInflM870y03 R9DQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=ncMHZoHeJ1/R3m//Gxdy4e2AOVai4/MkjcejBydaRcs=; b=ZFCBc0wiLXDCxJ0sWg+rTDO/2hThcBYDaS07DUWg4ySzY2q8vuhhiWYBF1RYyQ2i+h ZzkJu81OU/AsqWObLW2ZWB/QoRH2+FOkfFuhRynByb/J8wK3H2WXDAocnSALDxSBAiwX HWBtL7QbjRqsSC7dHuCtgGmx9GI9qGjMkpENpIxaBhbdlwW5/JSEh4mZEDuZtZ+tjQfs 25jSGJwHSfZznC1fmFM/hk7Xts1/WeIeI6C1HR4NcP3xLuQuHgHveW6gs6I8pO/OAEXy 9LQgZGQHZkHNGgVs49bv8OGt+svp7Tr1P9phVxLDQQxYfs3pjC5HhtLcbTu0whb6GqRG 8buQ== X-Gm-Message-State: AOAM530aR9jfESkzw5jKIOvowSLFurVMaKfb5kWihC10DS58eF9WFdgU VX5ixGojaxTzVlDQxka45ZlWDA== X-Google-Smtp-Source: ABdhPJyT+xhyTHT7ypVPB8IKx1qRB/jJFF/3fBoAeJneCYOtFh3/7xs7VQYN7bhKl5nffZ4JOcVSgA== X-Received: by 2002:a05:600c:3586:: with SMTP id p6mr14010787wmq.48.1622212151904; Fri, 28 May 2021 07:29:11 -0700 (PDT) Received: from localhost.localdomain (62-47-144-178.adsl.highway.telekom.at. [62.47.144.178]) by smtp.gmail.com with ESMTPSA id s14sm7212574wrv.56.2021.05.28.07.29.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 May 2021 07:29:11 -0700 (PDT) Message-ID: <7fa8483c9d3d1fdc12c3b6aba1eb637ce366b370.camel@cybertec.at> Subject: Re: Upgrading password encryption from md5 to scram-sh-256 From: Laurenz Albe To: Nikhil Shetty , pgsql-admin@postgresql.org Date: Fri, 28 May 2021 16:29:10 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 2021-05-28 at 18:57 +0530, Nikhil Shetty wrote: > As per documentation, for upgrading password encryption from md5 to scram-sha-256, > we have to set password_encryption to scram-sha-256, reset the user password and > then change in pg_hba.conf. > > Is there any other way to do this without changing the password? if there are a lot > of login users in the database it becomes difficult and it may incur downtime as well. > > I see there is a way the users can do it by themselves but still will incur some downtime. There is no other way than for the users to set the password again, because PostgreSQL doesn't know the original password. You can leave the "pg_hba.conf" entry set to "md5", then users can login with scram-sha-256 passwords as well as with md5 passwords. That can make the transition painless. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com