Skip to content


Checking PostgreSQL Database Creation Date

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:

  1. PostgreSQL Collation – part 2 Due to many questions about the PostgreSQL collation that were...
  2. Trying to Use Database in Python Why the f**** there is nothing like DBI in Python?...
  3. PostgreSQL Wishlist PostgreSQL is a great database, in my opinion much...
  4. Testing Database – Small Reply On Ovid’s blog I found lately this entry. First of...
  5. PostgreSQL Collation – part 1 PostgreSQL is (IMHO) much better than MySQL but unfortunately it ...
  6. PostgreSQL Collation – 8.4 In the last PostgreSQL version (8.4) there is a small...

Posted in database.

Tagged with , .


2 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. juro says

    That’s really sad.
    However, some workaround is here
    http://www.varlena.com/GeneralBits/55.php
    in the post
    When was this database created?

  2. Simon says

    Youp… not really as this method just gives some approximation, not the real date.



Some HTML is OK

or, reply to this post via trackback.



Better Tag Cloud