Re: Last modification time of a database? - Mailing list pgsql-general

From Tom Lane
Subject Re: Last modification time of a database?
Date
Msg-id 13630.1237942059@sss.pgh.pa.us
Whole thread Raw
In response to Re: Last modification time of a database?  (Erik Jones <ejones@engineyard.com>)
List pgsql-general
Erik Jones <ejones@engineyard.com> writes:
> These are all client databases at the web hosting company I work at.
> I can't go putting triggers on all of their tables.  I think I'll just
> start taking snapshots of pertinent data from pg_stat_activity and
> after I've been collecting data for a while run a report of dbs that
> haven't seen connections in X long since what I'm really after is
> inactive databases.

It seems like a pretty low-precision result would be sufficient for what
you need.  Have you tried just tracking the last file mod time within
each database directory?  This would be later than the real last use
due to delayed vacuum, etc, but it might be good enough.

            regards, tom lane

pgsql-general by date:

Previous
From: Erik Jones
Date:
Subject: Re: Last modification time of a database?
Next
From: berdam
Date:
Subject: Re: Res: Case sensitivity problems with user name