I'm trying to determine when the last Postgres upgrade was made. I know my current version (through "show server_version" command, and other ways too). But I wasn't able to find a history of the last upgrades and the respective dates. Is there such a thing?

An analogy: this can be achieved with the file $II_SYSTEM/ingres/version.dat in an Ingres DBMS.

  • Thanks @EvanCarroll and @PatrickMevzek! Evan's answer solved the issue, but Patrick's could be important in some situations. In addition to the dnf history list command, I also used rpm -qa --last | grep -i postgres to help me narrow the analysis. – Carlos Mazzini Jan 19 '18 at 15:38

You're using Redhat, so it's stored under dnf history list. It's a function of the package manager, not the database. You can build your own PostgreSQL and install and that won't show under the package manager.

The database engine itself doesn't track revisions to itself in the database: and, it would be weird if it did. If Redhat issues an upgrade and restarts the server, the server is supposed to know that Redhat issued an upgrade? What if the upgrade was a minor fix that Redhat pushed out ahead of PostgreSQL?

| improve this answer | |
  • 2
    Also, depending on the upgrades and the log retention, if you search inside the logs you will find each time PostgreSQL starts and it should show you also which specific version. This may however not show absolutely all upgrades, as some local OS security fixes for example may not change the PostgreSQL version. – Patrick Mevzek Jan 19 '18 at 2:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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