Re: last insert/update for a table - Mailing list pgsql-admin

From Kevin Grittner
Subject Re: last insert/update for a table
Date
Msg-id 4B58349D020000250002E98E@gw.wicourts.gov
Whole thread Raw
In response to last insert/update for a table  (Kevin Kempter <kevink@consistentstate.com>)
List pgsql-admin
Kevin Kempter <kevink@consistentstate.com> wrote:

> is there a system catalog query or function that will show me the
> last time  an insert or update occurred for a specified table ?

That would be rather expensive to maintain.  You could almost count
on looking at the timestamps on the underlying files, except that
various maintenance, like setting hint bits and vacuuming, would
cause changes there in addition to inserts and updates.

If this is some sort of audit because of suspected inappropriate
actions, be sure you capture a copy of the database ASAP.  You might
be able to figure something useful based on the xmin and xmax values
for tuples.  Without knowing exactly why you want this, it's hard to
offer specific advice.

-Kevin

pgsql-admin by date:

Previous
From: Uwe Bartels
Date:
Subject: vacuum + autovacuum
Next
From: Kevin Kempter
Date:
Subject: query to list all user tables and related constraints