Get database creation date on PostgreSQL

前端 未结 2 1220
春和景丽
春和景丽 2020-12-30 02:23

I want to get the Database creation date in POSTGRESQL. My version is 9.3.4 running on Ubuntu 14.04. Can I do it with a select statement or can I do it with acc

2条回答
  •  遥遥无期
    2020-12-30 02:46

    I completely agree with Craig Ringer (excellent answer!)... but for my purposes , this is good enough:

    SELECT (pg_stat_file('base/'||oid ||'/PG_VERSION')).modification, datname FROM pg_database;
    

    Simple and clean (but superuser).

提交回复
热议问题