Record Insertion/Update time

Is there a way to get the last record insert/update time in RDBMS. I am specifically looking if PostgreSQL database has a way to provide me this.

I know i can code for this in my every UPDATE/INSERT statement. But if i database can provide me this for every record without me doing any coding that would be great.

Help !!
LVL 1
JituAsked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
Unless you implement a strategy to log this, you don't have this information by the database.
Many database systems have some kind of transaction log, but performing an analysis of this takes huge time and often requires some tools...

Ususally, you use some kind of triggers, but I would have to look up how/if this works in PostgrSQL.

CHeers
0
 
JituAuthor Commented:
i think "last record insert/update time" is not clear enough.

What i mean is - for any record in the database i should be able to find out when was the record last updated.
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
You have to store this information per row... again, this is not implemented by default, so you need to implement this on your own...
CHeers
0
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
vbDocCommented:
The accepted method is to use a trigger on UPDATE to put an entry in a LOG table. Then a simple SQL statement to find the entry.

Regards
0
 
JituAuthor Commented:
So u mean i would have to put a trigger on update on all my  tables in the database ?
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
Absolutely...
0
 
JituAuthor Commented:
Thanks Angel !!!
Oh the strange ways of Databases. !
0
 
JituAuthor Commented:
if PostgreSQL has a facility do let me know. I don;t think it would have !
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.