On development server I’d like to remove unused databases. To realize that I need to know if database is still used by someone or not.
Is there a way to get last access or modification date of given database, schema or table?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can do it via checking last modification time of table’s file.
In postgresql,every table correspond one or more os files,like this:
the relfilenode is the file name of table “test”.Then you could find the file in the database’s directory.
in my test environment:
the last command means listing all files ordered by last modification time.