How do I find the last time that a PostgreSQL database has been updated?

前端 未结 5 1937
我寻月下人不归
我寻月下人不归 2021-02-01 05:52

I am working with a postgreSQL database that gets updated in batches. I need to know when the last time that the database (or a table in the database)has been updated or modifie

5条回答
  •  日久生厌
    2021-02-01 06:31

    You can write a stored procedure in an "untrusted language" (e.g. plpythonu): This allows access to the files in the postgres "base" directory. Return the larges mtime of these files in the stored procedure.

    But this is only vague, since vacuum will change these files and the mtime.

提交回复
热议问题