Re: When was my database created - Mailing list pgsql-sql

From Steve Crawford
Subject Re: When was my database created
Date
Msg-id 4877ACC6.3010606@pinpointresearch.com
Whole thread Raw
In response to When was my database created  ("Matthew T. O'Connor" <matthew@zeut.net>)
List pgsql-sql
Matthew T. O'Connor wrote:
>
> How do I tell how old my database is, that is, when was create db for 
> this database done?
>
Short answer: you can't - at least not reliably and directly.

You can look in the data directory associated with the database in which 
you are interested and check the earliest file timestamp or the 
timestamp of the PG_VERSION file.

*IF* the files weren't touched and *if* they weren't manually copied at 
any time (and, of course if the clock was set correctly when the DB was 
created) then they *probably* represent the time the current version of 
the database was created. If you restored from a dump or otherwise 
recreated the database for any reason (version upgrade, machine 
migration, disaster recovery, etc.), the timestamps would represent the 
time of the restore, not the time of the creation of the original database.

Cheers,
Steve



pgsql-sql by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Rollback in Postgres
Next
From: Tom Lane
Date:
Subject: Re: Unnecessary repeat condition for a self inner join