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 1jXl2X-0002jJ-0z for pgsql-admin@arkaria.postgresql.org; Sun, 10 May 2020 12:26:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jXl2V-0004tx-Rq for pgsql-admin@arkaria.postgresql.org; Sun, 10 May 2020 12:26:39 +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 1jXl2V-0004tq-KK for pgsql-admin@lists.postgresql.org; Sun, 10 May 2020 12:26:39 +0000 Received: from mail-oo1-xc41.google.com ([2607:f8b0:4864:20::c41]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jXl2T-0001cH-K9 for pgsql-admin@lists.postgresql.org; Sun, 10 May 2020 12:26:38 +0000 Received: by mail-oo1-xc41.google.com with SMTP id v6so1354213oou.4 for ; Sun, 10 May 2020 05:26:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=Lm6QtWYUZgrR6sCsiUW5wZHNAKlGgPyrJKM7iLOcJp8=; b=g4XJ7DhJPLhrTZnZEu65+G/Q4FCW6TXb87LxAWbC1NZ0fBtZ2IkXgEyz7W648zRimy 4Q90/GqgqbE6Uc8ll7MUQGVoLN1SKfNG6MdNR1o2kT/Man/h/cPKDnLVMQMM6bx84Y7j mISX8qhGjL2ZieK4VhrvSinuRmOXsU6bgwGxSewQsBV3sA2KWqe512wVybyHO6/7H++K WyBO6bu23nK9kSdhJ+MlI9CDCaYUMymA9BDMQWdTsGBjWVO1+rTnGvMNYo/xP4BFEB3D kzO9vt53HvCQgnrdGN1H8zvKjBPYMuYF62S/J3KnODaEuHC9ssb5d/1iVf3vxAVPVOer v5rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=Lm6QtWYUZgrR6sCsiUW5wZHNAKlGgPyrJKM7iLOcJp8=; b=EvY4RYAwfnsY21mprQYtc+M5B5SvV6hPoztH/BVByVSp/UBXfT5r999ZnXlI8s0A7w B0OdgQqgK56mySREMFPKTnUL0lmMUfpxVokon4BkY8tTxM8sWoYIgQLbJoot3gqV9gmp u3m9/ebGWdv0gCr/DcF+hhrdqcqdlf/0TPJjxZT1C0khFLRJ4o50Cd6kahq39zoiVSIu WVMkheBj65O5NP3kDMFF4MDDYKrreMjHpo5GuNhVG3wSUy3c2t2nHHwwinXbf163lLe3 aiMkz/I8VKrSZglUt62SDmRoDQ+eJvCP/QFZUFvZn+Wa+NoLivRhnj2SaaCVtdfubqEM 4JSA== X-Gm-Message-State: AGi0Puaz2skh2bEJH8NMN8bM86riJOzkkPxlcy599rupTtz708sFgX4K PpE4dxI/mulCjAgCGirfG3ACVmubAMY= X-Google-Smtp-Source: APiQypL4Uqs4o9mzloEgOlk5ezp5V5UXfJlAqUjTNY15D3GdTov7GiKsP3YpaEm79r8eAojFAKRtpg== X-Received: by 2002:a4a:c217:: with SMTP id z23mr9830917oop.21.1589113596881; Sun, 10 May 2020 05:26:36 -0700 (PDT) Received: from [192.168.1.10] (ip70-186-126-197.no.no.cox.net. [70.186.126.197]) by smtp.googlemail.com with ESMTPSA id 97sm915511otm.78.2020.05.10.05.26.36 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 10 May 2020 05:26:36 -0700 (PDT) Subject: Re: Deactivate/disable User id in Postgres To: pgsql-admin@lists.postgresql.org References: <1590FC39-7BA9-4B29-953E-7C01E70E52E9@gmail.com> From: Ron Message-ID: <90ea24a1-1a28-746d-d94a-bc17a430f4a4@gmail.com> Date: Sun, 10 May 2020 07:26:35 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <1590FC39-7BA9-4B29-953E-7C01E70E52E9@gmail.com> Content-Type: multipart/alternative; boundary="------------5FD5CF4EB8F0E1D5399E9F2B" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------5FD5CF4EB8F0E1D5399E9F2B Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit What about setting the password expiration to "now"?  That also would prevent the user from logging in. On 5/4/20 6:50 AM, John Scalia wrote: > Setting the role for NOLOGIN is probably your best route. You could also > revoke their privileges on any database object, if you were especially > concerned. > — > Jay > > Sent from my iPad > >> On May 4, 2020, at 7:30 AM, Rajin Raj wrote: >> >>  >> Hi, >> >> Is there any option to deactivate/disable a user id in Postgres? >> I can think of below two options, >> >> ALTER USER WITH CONNECTION LIMIT 0; >> ALTER USER WITH NOLOGIN >> >> Is there any better approach? >> >> *Regards,* >> *Rajin * -- Angular momentum makes the world go 'round. --------------5FD5CF4EB8F0E1D5399E9F2B Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit What about setting the password expiration to "now"?  That also would prevent the user from logging in.

On 5/4/20 6:50 AM, John Scalia wrote:
Setting the role for NOLOGIN is probably your best route. You could also revoke their privileges on any database object, if you were especially concerned.
—
Jay

Sent from my iPad

On May 4, 2020, at 7:30 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 

--
Angular momentum makes the world go 'round.
--------------5FD5CF4EB8F0E1D5399E9F2B--