Skip site navigation (1) Skip section navigation (2)

Re: When was my database created

From: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
To: "Matthew T(dot) O'Connor" <matthew(at)zeut(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: When was my database created
Date: 2008-07-11 18:56:06
Message-ID: 4877ACC6.3010606@pinpointresearch.com (view raw or flat)
Thread:
Lists: 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


In response to

pgsql-sql by date

Next:From: Simon RiggsDate: 2008-07-11 18:58:48
Subject: Re: Rollback in Postgres
Previous:From: daniel blancoDate: 2008-07-11 18:34:03
Subject: function that returns a set of records and integer(both of them)‏

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group