Re: Adding date column to system catalog "pg_database"

Поиск
Список
Период
Сортировка
От Shreeyansh Dba
Тема Re: Adding date column to system catalog "pg_database"
Дата
Msg-id CAGDYbUP2ruZ2MXX8SEhCi=wm_evseWHVWuonC=wOcWnOfG1sxA@mail.gmail.com
обсуждение исходный текст
Ответ на Adding date column to system catalog "pg_database"  (pavan95 <pavan.postgresdba@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Achilleas Mantzios
Дата:
Сообщение: Re: Adding date column to system catalog "pg_database"
Следующее
От: Owayss Kabtoul
Дата:
Сообщение: High CPU load caused by the autovacuum launcher process