Re: Adding date column to system catalog "pg_database"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx> 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



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux