On Jun 14, 12:57 pm, Lza <dayw...@xxxxxxxxx> wrote: > Can anyone help me with this problem? > > I have a table in my database that holds information on policies and > this table is linked to a number of other tables. I need to be able to > keep a history of all changes to a policy over time. The other tables > that are linked to policy also need to store historical data. When I > run a query on the policy table for a certain period, I also need to > be able to pull the correct related rows (i.e. the information that > would have been in the table at that time) from the tables linked to > it. > > Does anyone have any suggestions on how to store historical > information in databases? Any good resources (books, etc..) that cover > this information? > > Thanks for your time. See: http://www.postgresql.org/docs/8.2/static/plpgsql-trigger.html Search for: "Example 37-3. A PL/pgSQL Trigger Procedure For Auditing"