Re: when was a db/schema created ?

From: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
To: "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: when was a db/schema created ?
Date: 2012-09-17 22:41:47
Message-ID: CAK3UJRE_Ae050xLrs8+2DfLVXcbD85YH9_DPA0AHFqK3c7M+eA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Sep 17, 2012 at 2:16 PM, Gauthier, Dave <dave(dot)gauthier(at)intel(dot)com> wrote:
> Is there a way to determine when a DB was created (create database...)?

If you don't have the CREATE DATABASE statement in your logs, you could try

SELECT oid FROM pg_database WHERE datname = 'name of your database';

Then check the creation time of the directory with that OID in your
$PGDATA directory, under ./base/.

Josh

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mike Christensen 2012-09-17 22:53:24 Re: RFE: Column aliases in WHERE clauses
Previous Message Daniel Serodio (lists) 2012-09-17 22:10:48 Re: RFE: Column aliases in WHERE clauses