In my uses of PostgreSQL, I'm developing a revision control system for some of my data, and I'd like it to be handled in PostgreSQL to make the interface in the application much simpler. The challenge I face now is to create a rollback system so that when a revision is deleted, the data in the actual information table is rolled back to its state prior to the revision that was just deleted. I set up foreign keys in the revision table so it would cause a chain reaction and delete all revisions on that same document after the one to be deleted, but this is where it stops functioning as I need it to.
PostgreSQL deletes the requested row first, then cascades to the next row, which triggers a cascade to the next, and so on. For my rollback, however, I need to be able to delete the last revision first, and rollback one revision at a time until the initially specified revision is deleted.
Is there a way to instruct PostgreSQL to perform the cascade in reverse order like this, or do I need to create a seperate function to search for and delete the revisions without the aid of the foreign key? Any help in this area would be greatly appreciated.
Thank you, Marty Alchin
_________________________________________________________________
Overwhelmed by debt? Find out how to ‘Dig Yourself Out of Debt’ from MSN Money. http://special.msn.com/money/0407debt.armx
---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly