Re: Creation date of postgres database

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Pradeep Sharma <pradeep(dot)sharma(at)in2m(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Creation date of postgres database
Date: 2006-03-30 11:06:26
Message-ID: 20060330110626.GA98684@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Thu, Mar 30, 2006 at 02:05:24PM +0530, Pradeep Sharma wrote:
> Is there any way to get the date of creation of a database in Postgres?
> Does postgres store this information in any system table.

I'm not aware that the creation time is stored anywhere (except
perhaps in query logs) but you might be able to infer it from the
modification times of the oldest files in the database's directory.
PG_VERSION looks like a good candidate -- the backend probably
doesn't modify it after the database is created, so if nothing at
the OS level has touched that file then its modification time should
reflect the database's creation time.

--
Michael Fuhr

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Pradeep Sharma 2006-03-30 11:50:00 Re: Creation date of postgres database
Previous Message Pradeep Sharma 2006-03-30 08:35:24 Creation date of postgres database