Re: Last insert/update/delete time for a table

From: Richard Huxton <dev(at)archonet(dot)com>
To: Aleksander Kmetec - INTERA <aleksander(dot)kmetec(at)intera(dot)si>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Last insert/update/delete time for a table
Date: 2008-04-25 13:26:26
Message-ID: 4811DC02.6030800@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Aleksander Kmetec - INTERA wrote:
> Hi all,
>
> I'm in the process of writing a backup script which only dumps those
> tables which were changed in the last 24 hours. We have hundreds of
> tables (one per user), but most of them don't get changed very often, so
> there's no point in dumping them every night.
>
> Is there a way to get the time of the last insert, update or delete
> statement for a specific table?

You can always look at pg_stat_user_tables on a regular basis (see ch 26
of the docs). Note that there is a small chance not all updates will be
recorded here.

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Fujii Masao 2008-04-25 14:25:29 Re: Last insert/update/delete time for a table
Previous Message Andrew Sullivan 2008-04-25 13:01:48 Re: Last insert/update/delete time for a table