473,500 Members | 1,943 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cascade Order

Fir of all, hello to all of you. I'm new to this list, and I apologize if
this has already been asked, but the mailing list archives don't seem to be
responding at the moment for me to search through.

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 ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #1
0 1063

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
5883
by: Fraser Hanson | last post by:
Hello, I have a table which has a foreign key relationship with itself. I want and expect my updates to cascade (deletes definitely cascade as expected) but instead I just get error 1217:...
1
8854
by: Andrew DeFaria | last post by:
I created the following .sql file to demonstrate a problem I'm having. According to the manual: If |ON DELETE CASCADE| is specified, and a row in the parent table is deleted, then InnoDB...
6
2311
by: Richard Barnet | last post by:
Dear CSS gurus, My question regarding 'the cascade' is a simple one, but one that I haven't heard anyone talk about before: When cascading (for instance, when applying two linked stylesheets),...
2
6978
by: Jack | last post by:
We are have a question about the no cascade option on before triggers. The description stays that no other triggers will be fired by the changes of a before trigger. One of our developers is...
33
4238
by: Lee C. | last post by:
I'm finding this to be extremely difficult to set up. I understand that Access won't manage the primary key and the cascade updates for a table. Fine. I tried changing the PK type to number and...
2
2714
by: Mitchell Thomas | last post by:
I have 3 tables and they are all a one-one relationship. The tables are in oracle with Access as the front end. If user deletes a record from Table1, how do I programmatically delete the...
14
5761
by: Karl O. Pinc | last post by:
Hi, Thought perhaps some other eyes than mine can tell if I'm doing something wrong here or if there's a bug somewhere. I've never passed a ROWTYPE varaible to a function but I don't see where...
2
7641
by: nekiv90 | last post by:
Greetings, I have to delete older policies and its related records in other tables. The deletion from the parent table will trigger the deletion of relevant records from about 30 something...
31
6624
by: matthewslyman | last post by:
I have an unusual design and some very unusual issues with my code... I have forced Access to cooperate on everything except one issue - record deletion. My form design involves a recursively...
0
7136
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7232
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5490
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4923
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4611
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3110
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3106
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1430
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
672
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.