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 1jXl0U-0002dq-QF for pgsql-admin@arkaria.postgresql.org; Sun, 10 May 2020 12:24:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jXl0T-0007Ml-Mj for pgsql-admin@arkaria.postgresql.org; Sun, 10 May 2020 12:24:33 +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 1jXl0T-0007Me-FG for pgsql-admin@lists.postgresql.org; Sun, 10 May 2020 12:24:33 +0000 Received: from mail-ot1-x341.google.com ([2607:f8b0:4864:20::341]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jXl0R-0001ay-8T for pgsql-admin@lists.postgresql.org; Sun, 10 May 2020 12:24:32 +0000 Received: by mail-ot1-x341.google.com with SMTP id e20so5298335otk.12 for ; Sun, 10 May 2020 05:24:31 -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=CW076Ca1GZVT25lXSfxG15+5IZ1LQICIa8f3W5T9vPY=; b=BFDNcJ2g1ANnDfA8LnTMwjvxw/o8EHlU29jZRR5B3C2fLYSMq19csfaaJzqqRQzf5N 76V3nmAORV28e/wUKkwbcJZrwzpajFP11sHvACPQgzqcqe6D0IKPR/r0+yCIxSt7eQa4 yIkJ5hZsSTpavk3epYaok1DGmzVPr32ehtShiyKl3gw7vRogUINhZ6t8a/3PuGILts5N 7Dv3Q3ZdWCXXH4GMUvQmmYa7pM/iBdKyJiysx/cakI9SAFkAG7cSldU2neRQnBAC9lWr OROO/DB0XlG44uQM+RmGqKViEgCC5sFT1fN4b4bEbjb++HYKSuSxZWp9dMShaA+1XOYr JWlg== 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=CW076Ca1GZVT25lXSfxG15+5IZ1LQICIa8f3W5T9vPY=; b=NJUgTuiPjt2q7lZOP5AtmvUOREd8zMrLxY0Zs+wsgjJUEWWMR3Q9PulBU7vm5/PAvQ Oo28f/pBfVLcxM2wa9dkfCRjGyUi/3G+f/U9P3D+TE/st+SbOBa2PnvxYv9GS3uUb8eY 6I95NnTiEoqRfuHchaydShO92QorKK80DzDRVlulikIkr/eyE2JQmQHZlJEBdSzXfEGZ W8fqqSLOePVG3KM+SRI8Cwsy87T7dTjfsNGQGKrj5kytK5FEu9UxPDQIx8E6diyZeMVt WmoRLQCBQPlNeoF9N04oXUYsY4iO253/bKRv6NPjHWVDMZuuFWtQK84+9vXgAwJWd4ux us6A== X-Gm-Message-State: AGi0Pub4W3sl+FfVuISNkY/9/OhphrSPbkAu8Q99E/YA6abbDj9/ROLO 1QR0AEBfdR6pE0HadGGIXIwrXSHLv2Y= X-Google-Smtp-Source: APiQypIFRRK9jlXDquLVeUAQqXwjC+Qw+JXg+90KjDm1itlnMkgImN0G4dli+L4d/CI+eY6fBtvp/A== X-Received: by 2002:a9d:12b6:: with SMTP id g51mr9475466otg.187.1589113470021; Sun, 10 May 2020 05:24:30 -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 d18sm1893311otk.63.2020.05.10.05.24.29 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 10 May 2020 05:24:29 -0700 (PDT) Subject: Re: Deactivate/disable User id in Postgres To: pgsql-admin@lists.postgresql.org References: From: Ron Message-ID: <74156874-be59-bcf9-b8c9-a7bd85b9a53e@gmail.com> Date: Sun, 10 May 2020 07:24:28 -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: Content-Type: multipart/alternative; boundary="------------5D76B795A20E63753B8CB9A9" 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. --------------5D76B795A20E63753B8CB9A9 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 5/4/20 9:45 AM, Rui DeSousa wrote: > > >> On May 4, 2020, at 7:29 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 * > > Using external authentication is an option too. i.e. using LDAP; disabling > the account in LDAP means the user cannot login. That would be a disaster in an enterprise that has many systems, and uses LDAP/AD for account management. -- Angular momentum makes the world go 'round. --------------5D76B795A20E63753B8CB9A9 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit On 5/4/20 9:45 AM, Rui DeSousa wrote:


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.

That would be a disaster in an enterprise that has many systems, and uses LDAP/AD for account management.

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