Re: get last timestamp of table ddl

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: Luca Ferrari <fluca1978(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: get last timestamp of table ddl
Date: 2021-11-24 14:09:58
Message-ID: 20211124140958.GA20928@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Nov 24, 2021 at 02:53:24PM +0100, Luca Ferrari wrote:
> Hi all,
> I think I already know the answer, however I came across this table in
> Oracle <https://docs.oracle.com/cd/B19306_01/server.102/b14237/statviews_2005.htm#i1583352>
> that has two columns that triggered my attention: CREATED and
> LAST_DDL_TIME.
> Apart from being dates (in the Oracle way), they store the time of
> creation and last modification to the table structure.
> I don't have any particular use case except from blaming someone about
> a change in the database structure, however I'm curious: is there a
> smarter way to achieve this in PostgreSQL than simply relying on logs
> and commit timestamps?

You could add event triggers to achieve similar functionality.
https://www.depesz.com/2012/07/29/waiting-for-9-3-event-triggers/
and
https://www.postgresql.org/docs/current/sql-createeventtrigger.html

depesz

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message hubert depesz lubaczewski 2021-11-24 14:10:27 Re: How to set alias data type?
Previous Message Shaozhong SHI 2021-11-24 13:57:06 How to set alias data type?