Обсуждение: when was a db/schema created ?

Поиск
Список
Период
Сортировка

when was a db/schema created ?

От
"Gauthier, Dave"
Дата:

Is there a way to determine when a DB was created (create database...)?

Thanks in advance.

Re: when was a db/schema created ?

От
Fabrízio de Royes Mello
Дата:
2012/9/17 Gauthier, Dave <dave.gauthier@intel.com>

Is there a way to determine when a DB was created (create database...)?

Thanks in advance.


Dear Dave,

You can configure the "log_statement" [1] GUC to log DDL statements.

Regards,

Re: when was a db/schema created ?

От
Josh Kupershmidt
Дата:
On Mon, Sep 17, 2012 at 2:16 PM, Gauthier, Dave <dave.gauthier@intel.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