keeping track of when a row was last modified

Started by Sally Sallyabout 21 years ago4 messagesgeneral
Jump to latest
#1Sally Sally
dedeb17@hotmail.com

Does postgres automatically keep track of when a row was last modified?
Thanks

#2Thomas F.O'Connell
tfo@sitening.com
In reply to: Sally Sally (#1)
Re: keeping track of when a row was last modified

Nope, although there are plenty of trigger-based examples of doing so
in the archives.

-tfo

--
Thomas F. O'Connell
Co-Founder, Information Architect
Sitening, LLC
http://www.sitening.com/
110 30th Avenue North, Suite 6
Nashville, TN 37203-6320
615-260-0005

On Mar 10, 2005, at 3:15 PM, Sally Sally wrote:

Show quoted text

Does postgres automatically keep track of when a row was last modified?
Thanks

---------------------------(end of
broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

#3Michael Fuhr
mike@fuhr.org
In reply to: Sally Sally (#1)
Re: keeping track of when a row was last modified

On Thu, Mar 10, 2005 at 09:15:28PM +0000, Sally Sally wrote:

Does postgres automatically keep track of when a row was last modified?

No, but you can set up a trigger to do it. The "Trigger Procedures"
section of the PL/pgSQL chapter in the documentation has an example:

http://www.postgresql.org/docs/8.0/interactive/plpgsql-trigger.html

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

#4Sean Davis
sdavis2@mail.nih.gov
In reply to: Sally Sally (#1)
Re: keeping track of when a row was last modified

On Mar 10, 2005, at 4:15 PM, Sally Sally wrote:

Does postgres automatically keep track of when a row was last modified?
Thanks

No. If you look on the SQL list in the past ten-20 minutes, there has
been a discussion about this issue. Generally, you can use a trigger
to update a timestamp when a row is touched.

Sean