Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Is there a way to get a date and time of when a particular database was created in Postgresql?

The \list command does not provide a timestamp.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

There's no built-in method to do so, but there are workarounds.

Note however that even PG_VERSION changes when the server is updated to a new major version.

So the only reliable way to store a creation date is to make a one-row table with the date in it.

If this feature is important to your application you could consider funding its development. I think it'd be pretty trivial to implement.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.