From: | "Boget, Chris" <chris(at)wild(dot)net> |
---|---|
To: | "'Stephan Szabo '" <sszabo(at)megazone23(dot)bigpanda(dot)com>, "Boget, Chris" <chris(at)wild(dot)net> |
Cc: | "'''pgsql-general(at)postgresql(dot)org' ' '" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Constraints/On Delete... |
Date: | 2003-01-04 17:18:18 |
Message-ID: | 4040BBE81A9AD411BD27009027887A7C0431CC@tiger.wild.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
> ALTER TABLE "second" DROP CONSTRAINT "$1";
So the reason mine wasn't working (which looks exactly
like yours) is because there was the above constraint on
the table? What is the $1? How can I view the existing
constraints for any particular table?
> ALTER TABLE "second" ADD CONSTRAINT "secondfk"
> FOREIGN KEY (name) REFERENCES "first"("record_num")
> ON DELETE CASCADE;
This worked like a charm! Thank you very much for your help!
> No. Referential actions are applied on changes to the primary
> key side of the constraint (in this case "first"), so deletes
> from first cause actions on second.
Ok, I just wanted to make sure. It just looked like it was the
other way around. Because it appeared that the pointer (the
"references") was going from "second" to "first". I guess that
when records are deleted from the "first", it asks what tables are
referencing one of it's columns and it's not that it implicitely
already knows..?
Again, thank you for all your help!
Chris
From | Date | Subject | |
---|---|---|---|
Next Message | Stephan Szabo | 2003-01-04 17:23:07 | Re: Constraints/On Delete... |
Previous Message | Boget, Chris | 2003-01-04 17:06:37 | Re: Constraints/On Delete... |