Skip site navigation (1) Skip section navigation (2)

Re: last insert/update for a table

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Kevin Kempter" <kevink(at)consistentstate(dot)com>, <pgsql-admin(at)postgresql(dot)org>
Subject: Re: last insert/update for a table
Date: 2010-01-21 17:03:57
Message-ID: 4B58349D020000250002E98E@gw.wicourts.gov (view raw or flat)
Thread:
Lists: pgsql-admin
Kevin Kempter <kevink(at)consistentstate(dot)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

In response to

pgsql-admin by date

Next:From: Kevin KempterDate: 2010-01-22 05:14:39
Subject: query to list all user tables and related constraints
Previous:From: Uwe BartelsDate: 2010-01-21 07:52:25
Subject: vacuum + autovacuum

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group