This proposal is about add a column "datcreated" on "pg_database" to store
the "timestamp" of the database creation.
A couple weeks ago I had a trouble with a PostgreSQL instance, actually our
ERP had some strange behaviors with some data loss, but I searched for
ERRORs in log files (OS and PG) and I found nothing.
Looking at the files and directories in the cluster noticed something
strange, the date / time of the file "base/9999/PG_VERSION" (database of
our ERP) was different compared to when we create it. So I used the
following SQL to check the date / time of creation of the databases in the
fabrizio=# SELECT datname,
(pg_stat_file('base/'||oid||'/PG_VERSION')).modification AS datcreated
fabrizio-# FROM pg_database;
datname | datcreated
template1 | 2012-12-26 12:11:53-02
template0 | 2012-12-26 12:11:54-02
postgres | 2012-12-26 12:11:54-02
fabrizio | 2012-12-26 12:12:02-02
This isn't an elegant solution to do that, but worked fine. However, why
not we have a column to store this information?
Somebody have another idea?
Fabrízio de Royes Mello
>> Blog sobre TI: http://fabriziomello.blogspot.com
>> Perfil Linkedin: http://br.linkedin.com/in/fabriziomello
>> Twitter: http://twitter.com/fabriziomello
pgsql-hackers by date
|Next:||From: Josh Berkus||Date: 2012-12-27 01:08:13|
|Subject: Re: Proposal: Store "timestamptz" of database creation
|Previous:||From: Greg Stark||Date: 2012-12-27 00:23:43|
|Subject: Re: buffer assertion tripping under repeat pgbench load|