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 1jVcM0-0002D1-SR for pgsql-admin@arkaria.postgresql.org; Mon, 04 May 2020 14:45:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jVcLz-0004UA-Gy for pgsql-admin@arkaria.postgresql.org; Mon, 04 May 2020 14:45:55 +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 1jVcLz-0004TD-9e for pgsql-admin@lists.postgresql.org; Mon, 04 May 2020 14:45:55 +0000 Received: from impout003aa.msg.chrl.nc.charter.net ([47.43.20.27] helo=impout003.msg.chrl.nc.charter.net) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jVcLx-0003Fh-60 for pgsql-admin@lists.postgresql.org; Mon, 04 May 2020 14:45:54 +0000 Received: from cerberus.crazybean.net ([24.151.69.73]) by cmsmtp with ESMTP id VcLvj4OlvQFrUVcLvjnScA; Mon, 04 May 2020 14:45:52 +0000 Authentication-Results: crazybean.net; none X-Authority-Analysis: v=2.3 cv=Xf89M7x5 c=1 sm=1 tr=0 a=YXTuGtgWN9YX+aIhe8tYuA==:117 a=YXTuGtgWN9YX+aIhe8tYuA==:17 a=xqWC_Br6kY4A:10 a=sTwFKg_x9MkA:10 a=B9N9w1MLAAAA:8 a=QyBbsUpfHjYpGnK-MbIA:9 a=CjuIK1q_8ugA:10 a=6GERUJ5rpb69I3AIcEwA:9 a=PK5hXCbtgBlNltRc:21 a=_W_S_7VecoQA:10 a=vnk2IwSlPwaEWj_QrjiM:22 Received: from [IPv6:2001:470:e117:4:9847:3390:ee9a:ffd7] ( [2001:470:e117:4:9847:3390:ee9a:ffd7]) by cerberus.crazybean.net (OpenSMTPD) with ESMTPSA id ff6acaff (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Mon, 4 May 2020 10:45:50 -0400 (EDT) From: Rui DeSousa Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_6E5C77BD-B72B-488D-A31D-4B6CA9A11707" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: Deactivate/disable User id in Postgres Date: Mon, 4 May 2020 10:45:49 -0400 In-Reply-To: Cc: pgsql-admin@lists.postgresql.org To: Rajin Raj References: X-Mailer: Apple Mail (2.3608.80.23.2.2) X-CMAE-Envelope: MS4wfH9iCqmEIqcUOFLxGim7OJaOuG/rYC8QZTwxWYY00/Xq408E2emLpmQZKnH79VLM7HKgjUzb5ZxLkb14aiUGjqG4vKkFIng74ZGCTVAMfeHItOvz09VL v4GKIWgIQ3kmJ2+Ecf9eJw18XFOyrNwa1kG0E0H3pTV7zQcloNCzPX3um1PwhZLN2ZgtzEItu+OiLRQ1cNQrX4oeRBhKPMTDdjJsl7ckGa9fsyzGuM7vgbEZ List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail=_6E5C77BD-B72B-488D-A31D-4B6CA9A11707 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On May 4, 2020, at 7:29 AM, Rajin Raj wrote: >=20 > Hi, >=20 > Is there any option to deactivate/disable a user id in Postgres? > I can think of below two options,=20 >=20 > ALTER USER WITH CONNECTION LIMIT 0; > ALTER USER WITH NOLOGIN >=20 > Is there any better approach?=20 >=20 > Regards, > Rajin=20 Using external authentication is an option too. i.e. using LDAP; = disabling the account in LDAP means the user cannot login.= --Apple-Mail=_6E5C77BD-B72B-488D-A31D-4B6CA9A11707 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii

On May 4, 2020, at 7:29 AM, Rajin Raj <rajin.raj@opsveda.com> wrote:

Hi,

Is there any option to = deactivate/disable a user id in Postgres?
I can = think of below two options, 

ALTER = USER <user_id> WITH CONNECTION LIMIT 0;
ALTER = USER <user_id> WITH NOLOGIN

Is = there any better approach? 

Regards,
Rajin 

Using external = authentication is an option too. i.e. using LDAP; disabling the account = in LDAP means the user cannot login.
= --Apple-Mail=_6E5C77BD-B72B-488D-A31D-4B6CA9A11707--