pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: hubert depesz lubaczewski <depesz@depesz.com>
To: Luca Ferrari <fluca1978@gmail.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: get last timestamp of table ddl
Date: Wed, 24 Nov 2021 15:09:58 +0100
Message-ID: <20211124140958.GA20928@depesz.com> (raw)
In-Reply-To: <CAKoxK+5uz67DxYcF=6ese6imi7ovHoqwjB+YE4X46sNv_9KN0w@mail.gmail.com>
References: <CAKoxK+5uz67DxYcF=6ese6imi7ovHoqwjB+YE4X46sNv_9KN0w@mail.gmail.com>

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





view thread (5+ messages)  latest in thread

Message-ID: <20211124140958.GA20928@depesz.com>
Permalink:  ../20211124140958.GA20928@depesz.com/
Also on:    postgresql.org/message-id/20211124140958.GA20928@depesz.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: depesz@depesz.com, fluca1978@gmail.com
  Subject: Re: get last timestamp of table ddl
  In-Reply-To: <20211124140958.GA20928@depesz.com>
  References: <CAKoxK+5uz67DxYcF=6ese6imi7ovHoqwjB+YE4X46sNv_9KN0w@mail.gmail.com> <20211124140958.GA20928@depesz.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox