Re: Adding date column to system catalog "pg_database" - Mailing list pgsql-admin

From Shreeyansh Dba
Subject Re: Adding date column to system catalog "pg_database"
Date
Msg-id CAGDYbUP2ruZ2MXX8SEhCi=wm_evseWHVWuonC=wOcWnOfG1sxA@mail.gmail.com
Whole thread Raw
In response to Adding date column to system catalog "pg_database"  (pavan95 <pavan.postgresdba@gmail.com>)
List pgsql-admin
Hi Pavan,

As  pg_database is a system catalog table and you can not add or alter it even you are superuser.

You can get the database related information which you are looking for using below query.

SELECT (pg_stat_file('base/'||oid ||'/PG_VERSION')).modification, datname FROM pg_database;

Hope this helps..



On Thu, Jun 7, 2018 at 4:35 PM, pavan95 <pavan.postgresdba@gmail.com> wrote:
Hi all,

Is it possible to add date column to "pg_database" view by altering the
table?

Reason is to get the created date of each database, I will schedule a
trigger to update the date column with current server time. By this I can
get the db creation date every now from the point of creation of new db.

Any ideas in accomplishment of this task are of great help!

Thanks in advance.



Regards,
Pavan



--
Sent from: http://www.postgresql-archive.org/PostgreSQL-admin-f2076596.html


pgsql-admin by date:

Previous
From: Achilleas Mantzios
Date:
Subject: Re: Adding date column to system catalog "pg_database"
Next
From: Owayss Kabtoul
Date:
Subject: High CPU load caused by the autovacuum launcher process