Re: Get the date of creation of objects in the database

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "Edson F(dot) Lidorio" <edson(at)openmailbox(dot)org>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Get the date of creation of objects in the database
Date: 2016-02-23 03:50:19
Message-ID: 20160223035018.GB3127@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

David,

* David G. Johnston (david(dot)g(dot)johnston(at)gmail(dot)com) wrote:
> The only source of data for that question is the local filesystem. If
> that is acceptable you can find examples online provided to others who have
> asked this question.

What on the local filesystem would help here..? All you know from that
is when the relfilenode was created, but that's not the same as when the
table was created in the face of various commands that we have which
change the relfilenode..

> If you want something internal to the database the answer is no. Those
> same searches will turn up the various reasons why such a feature has not
> gotten any strong traction from the developers.

> This was my search query: "postgresql object creation time"

At least on a first blush look through the threads linked from such a
search, I'm unimpressed by the arguments against and note that there are
quite a few arguments for.

The summary of comments seems to be:

1) We don't know what we want

Doesn't seem terribly hard to define.

Object creation time (aka: CREATE TABLE time)
Object modification time (aka: ALTER TABLE time)

We could provide a function for 'last data modification time' which
simply uses the filesystem modification time.

2) It'll be expensive to keep track of

We often claim that we aren't too worried about DDL cost, and this
would be a very small additional cost on top of that. If it's
measurable then perhaps we could avoid doing it for temp tables, but
that strikes me as really the only case that it might be worthwhile
and I'm not convinced it is.

Thanks!

Stephen

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sridhar N Bamandlapally 2016-02-23 04:06:21 Re: JDBC behaviour
Previous Message Venkata Balaji N 2016-02-23 03:20:32 Re: Live steraming replication setup issue!