Обсуждение: [ADMIN] Table/View creation time

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

[ADMIN] Table/View creation time

От
Ram DBA
Дата:
Hi team,

Do we have a way of figuring out when a table/view is created in the postgres database?

ram=# \dv
         List of relations
 Schema |  Name  | Type |  Owner
--------+--------+------+----------
 public | v_test | view | postgres
(1 row)


Thank you,
Ram

Re: [ADMIN] Table/View creation time

От
Payal Singh
Дата:
You might be able to get some useful info by running stat on $PGDATA/base/<table's relid> (for instance when the file was created). Don't think this is applicable for a view though.

A better way is to search for the respective DDL command in postgres log files, if you are logging all DDLs

Payal

Payal Singh,
Database Administrator,
OmniTI Computer Consulting Inc.
Phone: 240.646.0770 x 253

On Mon, Jan 2, 2017 at 5:17 AM, Ram DBA <postgresdbas@gmail.com> wrote:
Hi team,

Do we have a way of figuring out when a table/view is created in the postgres database?

ram=# \dv
         List of relations
 Schema |  Name  | Type |  Owner
--------+--------+------+----------
 public | v_test | view | postgres
(1 row)


Thank you,
Ram

Re: [ADMIN] Table/View creation time

От
Avinash Patil
Дата:
Dear Payal,

You can find out time when any database objects are created By using Concepts of Event Trigger

Please refer this link 


Thanks
Avinash Patil

On Tue, Jan 3, 2017 at 8:53 PM, Payal Singh <payal@omniti.com> wrote:
You might be able to get some useful info by running stat on $PGDATA/base/<table's relid> (for instance when the file was created). Don't think this is applicable for a view though.

A better way is to search for the respective DDL command in postgres log files, if you are logging all DDLs

Payal

Payal Singh,
Database Administrator,
OmniTI Computer Consulting Inc.
Phone: 240.646.0770 x 253

On Mon, Jan 2, 2017 at 5:17 AM, Ram DBA <postgresdbas@gmail.com> wrote:
Hi team,

Do we have a way of figuring out when a table/view is created in the postgres database?

ram=# \dv
         List of relations
 Schema |  Name  | Type |  Owner
--------+--------+------+----------
 public | v_test | view | postgres
(1 row)


Thank you,
Ram




--
Thanks ,

Avinash Patil.

Re: [ADMIN] Table/View creation time

От
Achilleas Mantzios
Дата:
On 03/01/2017 17:23, Payal Singh wrote:
You might be able to get some useful info by running stat on $PGDATA/base/<table's relid> (for instance when the file was created). Don't think this is applicable for a view though.
Modern Linux'es do not support exposing creation time. EXT4 stores this though.

A better way is to search for the respective DDL command in postgres log files, if you are logging all DDLs

Payal

Payal Singh,
Database Administrator,
OmniTI Computer Consulting Inc.
Phone: 240.646.0770 x 253

On Mon, Jan 2, 2017 at 5:17 AM, Ram DBA <postgresdbas@gmail.com> wrote:
Hi team,

Do we have a way of figuring out when a table/view is created in the postgres database?

ram=# \dv
         List of relations
 Schema |  Name  | Type |  Owner
--------+--------+------+----------
 public | v_test | view | postgres
(1 row)


Thank you,
Ram



-- 
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt