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:
- Unit Test Your Database. I observe the endless war about TDD. On one side...
- Trying to Use Database in Python Why the f**** there is nothing like DBI in Python?...
- How to Store Application Settings Some ideas on how to store application settings in a...
- PostgreSQL Collation – part 2 Due to many questions about the PostgreSQL collation that were...
- Testing Database – Small Reply On Ovid’s blog I found lately this entry. First of...
- The Importance of Database Testing Basic Mistakes in Database Testing There is a huge number...













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.