Link to home
Start Free TrialLog in
Avatar of Jitu
Jitu

asked on

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 !!
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jitu
Jitu

ASKER

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.
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
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
Avatar of Jitu

ASKER

So u mean i would have to put a trigger on update on all my  tables in the database ?
Avatar of Jitu

ASKER

Thanks Angel !!!
Oh the strange ways of Databases. !
Avatar of Jitu

ASKER

if PostgreSQL has a facility do let me know. I don;t think it would have !