Some time ago we had a problem: on testing there were many versions of similiar databases, created by loading production databases’ dumps. So on testing we had to drop some databases but we had problems with choosing which to drop. We wanted to leave only the latest one.
The Story
It was simple: just check the database creation date. Unfortunately that information is not being stored in the database. Someone said that it was simple: just check the database OID number and then check the creation date of appropriate directory under the `data` dir. Sounded cool.
Realization
Well, that all happened on a linux based server. The directory/file creation date is not being stored.
The End
That’s said… there is no way to check the database creation date on PostgreSQL.
Related posts:
- PostgreSQL Collation – part 2 Due to many questions about the PostgreSQL collation that were...
- Trying to Use Database in Python Why the f**** there is nothing like DBI in Python?...
- PostgreSQL Wishlist PostgreSQL is a great database, in my opinion much...
- Testing Database – Small Reply On Ovid’s blog I found lately this entry. First of...
- PostgreSQL Collation – part 1 PostgreSQL is (IMHO) much better than MySQL but unfortunately it ...
- PostgreSQL Collation – 8.4 In the last PostgreSQL version (8.4) there is a small...













That’s really sad.
However, some workaround is here
http://www.varlena.com/GeneralBits/55.php
in the post
When was this database created?
Youp… not really as this method just gives some approximation, not the real date.