Re: User info?

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: "Carol Walter" <walterc(at)indiana(dot)edu>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: User info?
Date: 2008-12-03 16:53:14
Message-ID: dcc563d10812030853y4ccdb7b1u52682574890b94e3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Wed, Dec 3, 2008 at 8:30 AM, Carol Walter <walterc(at)indiana(dot)edu> wrote:
> Is there a way to tell when the last time a database in a cluster was
> accessed? I have a large number of student databases that are probably
> inactive, but I don't want to just destroy. I'd like to archive these, but
> I need to be able to tell when they were last accessed?

No direct method from within the db I know of, but you could use
oid2name / a list of db relids then go into the data/base directory
and see when the last time the files in the individual db directories
had been updated. That won't tell you the last time they were
ACCESSED, but will give you an idea if they're being updated or not.
Note that vacuum may change the last update times so it's not
foolproof by any means.

The other method is to log connections and then scrape the logs.

In response to

  • User info? at 2008-12-03 15:30:22 from Carol Walter

Browse pgsql-admin by date

  From Date Subject
Next Message Fabricio 2008-12-03 18:09:00 Re: User info?
Previous Message Carol Walter 2008-12-03 15:30:22 User info?