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 1lekKg-00030U-5M for pgsql-admin@arkaria.postgresql.org; Thu, 06 May 2021 20:10:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lekKd-0006qD-W4 for pgsql-admin@arkaria.postgresql.org; Thu, 06 May 2021 20:10:47 +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 1lekKd-0006pO-NO for pgsql-admin@lists.postgresql.org; Thu, 06 May 2021 20:10:47 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lekKb-0006vI-GO for pgsql-admin@lists.postgresql.org; Thu, 06 May 2021 20:10:46 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1lekKZ-0006OJ-Fv; Thu, 06 May 2021 16:10:43 -0400 Date: Thu, 6 May 2021 16:10:43 -0400 From: Bruce Momjian To: Vipin Madhusoodanan Cc: "pgsql-admin@lists.postgresql.org" Subject: Re: Query on User account password change details Message-ID: <20210506201043.GA10431@momjian.us> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, May 6, 2021 at 02:52:00PM -0500, Vipin Madhusoodanan wrote: > Hi Team, > > Please advise on the possibilities to retrieve “last password change date”  for > a PostgreSQL user account. We have an audit requirement to identify the > password change details for local PostgreSQL user accounts. We are able to > track AD users using AD Group Policy, but unable to fetch these details for > local user accounts. Tried to explore pg_users and pg_shadow catalog views, but > this information was not available.  Yep, it's not available. If you are authenticating Postgres using AD, you don't really change the password in Postgres, right? You can just check the AD date. I don't think triggers work on system tables, so I don't think that is an option. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com If only the physical world exists, free will is an illusion.