Обсуждение: [GENERAL] relation create time

Поиск
Список
Период
Сортировка

[GENERAL] relation create time

От
"Hu, Patricia"
Дата:

I am trying to find out when a table was created in postgresql. Thought it would be easy (coming from Oracle world), but haven’t had any luck, especially since we are on RDS and can’t peek at the timestamp on the file system. Is this information stored anywhere in the catalog? Or I need to store it myself? Is there any plan to add such meta data information to the catalog as a feature? Thanks a lot!

 

Thanks,

Patricia

 

Confidentiality Notice:: This email, including attachments, may include non-public, proprietary, confidential or legally privileged information. If you are not an intended recipient or an authorized agent of an intended recipient, you are hereby notified that any dissemination, distribution or copying of the information contained in or transmitted with this e-mail is unauthorized and strictly prohibited. If you have received this email in error, please notify the sender by replying to this message and permanently delete this e-mail, its attachments, and any copies of it immediately. You should not retain, copy or use this e-mail or any attachment for any purpose, nor disclose all or any part of the contents to any other person. Thank you.

Re: [GENERAL] relation create time

От
Peter Eisentraut
Дата:
On 5/10/17 12:05, Hu, Patricia wrote:
> I am trying to find out when a table was created in postgresql. Thought
> it would be easy (coming from Oracle world), but haven’t had any luck,
> especially since we are on RDS and can’t peek at the timestamp on the
> file system. Is this information stored anywhere in the catalog?

It is not.

> Or I
> need to store it myself? Is there any plan to add such meta data
> information to the catalog as a feature? Thanks a lot!

You could write an event trigger to record it.

--
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Re: [GENERAL] relation create time

От
"Hu, Patricia"
Дата:
Thanks for your prompt reply Peter.

Sure I could write a trigger to capture and store it, but for such common functionalities seems to me it would be best
tohave it in the engine, vs. each application having to write its own trigger and reinvent the wheel.  

Is there any concerns on adding it as a feature, or is it just backlog? Has a feature request been filed for this?

Thanks,
Patricia


-----Original Message-----
From: Peter Eisentraut [mailto:peter.eisentraut@2ndquadrant.com]
Sent: Wednesday, May 10, 2017 12:32 PM
To: Hu, Patricia; pgsql-general@postgresql.org
Subject: [EXTERNAL] Re: [GENERAL] relation create time

On 5/10/17 12:05, Hu, Patricia wrote:
> I am trying to find out when a table was created in postgresql.
> Thought it would be easy (coming from Oracle world), but haven't had
> any luck, especially since we are on RDS and can't peek at the
> timestamp on the file system. Is this information stored anywhere in the catalog?

It is not.

> Or I
> need to store it myself? Is there any plan to add such meta data
> information to the catalog as a feature? Thanks a lot!

You could write an event trigger to record it.

--
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Confidentiality Notice::  This email, including attachments, may include non-public, proprietary, confidential or
legallyprivileged information.  If you are not an intended recipient or an authorized agent of an intended recipient,
youare hereby notified that any dissemination, distribution or copying of the information contained in or transmitted
withthis e-mail is unauthorized and strictly prohibited.  If you have received this email in error, please notify the
senderby replying to this message and permanently delete this e-mail, its attachments, and any copies of it
immediately. You should not retain, copy or use this e-mail or any attachment for any purpose, nor disclose all or any
partof the contents to any other person. Thank you. 


Re: [GENERAL] relation create time

От
Melvin Davidson
Дата:


On Wed, May 10, 2017 at 12:31 PM, Peter Eisentraut <peter.eisentraut@2ndquadrant.com> wrote:
On 5/10/17 12:05, Hu, Patricia wrote:
> I am trying to find out when a table was created in postgresql. Thought
> it would be easy (coming from Oracle world), but haven’t had any luck,
> especially since we are on RDS and can’t peek at the timestamp on the
> file system. Is this information stored anywhere in the catalog?

It is not.

> Or I
> need to store it myself? Is there any plan to add such meta data
> information to the catalog as a feature? Thanks a lot!

You could write an event trigger to record it.

--
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

One option would be to set log_statement = 'ddl' , and make sure log_line_prefix includes time, then you can review the log for creation time.

Also, I have been requesting that feature for a long time, so if you want to add your support, vote for it at
https://postgresql.uservoice.com/forums/21853-general?filter=top&page=2

and look for relcreate
--
Melvin Davidson
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.