I have a small (~10 rows) table called restrictions in my PostgreSQL database, where values are deleted and inserted on a daily basis.
I would like to have a table called restrictions_deleted, where every row that is deleted from restrictions will be stored automatically. Since restrictions has a serial id, there will be no duplicates.
How do I write such a trigger in PostgreSQL?
VALUES((OLD).*)– KayEss Apr 16 '15 at 04:26create functionneeds to be called beforecreate trigger. And theVALUES((OLD).*)trick suggested by KayEss is nice. – mivk Apr 02 '16 at 14:14