Re: last update time of a table

From: Richard Huxton <dev(at)archonet(dot)com>
To: "pg" <pg(at)newhonest(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: last update time of a table
Date: 2003-12-05 09:53:56
Message-ID: 200312050953.56746.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Friday 05 December 2003 01:21, pg wrote:
> Is there any simple way to query the most recent time of "changes" made to
> a table?
>
> I'm accessing my database with ODBC to a remote site thru internet. I want
> to eliminate some DUPLICATE long queries by evaluating whether the data has
> been
> changed since last query. What should I do?

The canonical way is to add a last_changed column and a trigger to make sure
it gets updated whenever the rest of the row is.

Go over to http://techdocs.postgresql.org/ and check in the plpgsql cookbook
or my Postgresql notes, or the archives come to think of it.

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Wind Wood 2003-12-05 10:00:30 Re: query and pg_dump problem on my postgresql 6.5.3/Redhat 6.2 --fixed
Previous Message Thierry Missimilly 2003-12-05 09:40:41 Re: What is WAL used for?