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 1kZZ4X-0000EC-9m for pgsql-general@arkaria.postgresql.org; Mon, 02 Nov 2020 12:36:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kZZ4W-0001Ko-5h for pgsql-general@arkaria.postgresql.org; Mon, 02 Nov 2020 12:36:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kZZ4V-0001Kc-Sh for pgsql-general@lists.postgresql.org; Mon, 02 Nov 2020 12:36:27 +0000 Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kZZ4S-0002ym-VK for pgsql-general@postgresql.org; Mon, 02 Nov 2020 12:36:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20170201; h=In-Reply-To:Content-Type:MIME-Version:References:Reply-To: Message-ID:Subject:Cc:To:Sender:From:Date:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=f95/RKQCAjRPHEGsYnSw4gk9yM39SRKgjZJo6VthL4w=; b=QadulNimynJhpQBQauH/+hbQyA YWVoQtxqeqBnCFujKfQIph8ouFkXTrQCcfrVT4qe5L6ODYO8ywr0rzn6fe933pRfkbYcMzdUld/CG h+YGoRD4IsSF9MPBiTtzfZQ55gVcN01Im/UDD21E5BS05jWKCzh4WxV47L07AqPnML50=; Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by depesz.com with esmtpa (Exim 4.92) (envelope-from ) id 1kZZ4R-0001fp-MN; Mon, 02 Nov 2020 13:36:23 +0100 Date: Mon, 2 Nov 2020 13:36:23 +0100 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: paras paliya Cc: pgsql-general@postgresql.org Subject: Re: Last updated time for a Schema of the table Message-ID: <20201102123623.GA2821@depesz.com> Reply-To: depesz@depesz.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, Nov 02, 2020 at 03:23:06PM +0530, paras paliya wrote: > I need the last updated time or alter time of the table. Like changing the > column name or adding/deleting a column. Is there any table or view from > which I can get? PostgreSQL doesn't keep that information. You can: 1. set log_statement to ddl (or more) to log all schema changes 2. use event triggers to do whatever you want at the time of change. Best regards, depesz