Triggers don't activate when dropping table
I have one table named "object" and i many tables that are related to the table "object". When a record in "object" is deleted, the relative records in other tables should also be erased. To implement the above goal, i define many triggers on table "object" to make operations automatically.
But i find that the triggers don't activate when i dropping the table "object". So there is many garbage information left in the system which makes the system unstable.
Could anyone help?
Thank you!
simon
---------------------------------
Do You Yahoo!?
注锟斤拷锟斤拷锟斤拷一锟斤拷品锟绞碉拷锟脚伙拷锟斤拷训锟斤拷锟�
On Tue, Dec 07, 2004 at 11:44:58AM +0800, cheng shan wrote:
I have one table named "object" and i many tables that are related
to the table "object". When a record in "object" is deleted, the
relative records in other tables should also be erased. To implement
the above goal, i define many triggers on table "object" to make
operations automatically.But i find that the triggers don't activate when i dropping the
table "object". So there is many garbage information left in the
system which makes the system unstable.
If you want to fire the triggers then delete all records from the
table before dropping it. But why are you dropping the table?
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
Note: forwarded message attached.
---------------------------------
Do You Yahoo!?
注锟斤拷锟斤拷锟斤拷一锟斤拷品锟绞碉拷锟脚伙拷锟斤拷训锟斤拷锟�
Attachments:
test.sqltext/plain; name=test.sqlDownload+0-14
Import Notes
Resolved by subject fallback
On Tue, Dec 07, 2004 at 02:41:37PM +0800, cheng shan wrote:
In the first version, the function destroy_object_type( ) just drop
the table only. But when I find the triggers havn't been actived
yet, I add the delete setense. This time it becomes even worse,
the system throws error message.ERROR: could not open relation
with OID 1390714.
What's happening when you get this error? If you've been dropping
tables then you might have a problem with cached plans.
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
On Tue, 7 Dec 2004, cheng shan wrote:
In the first version, the function destroy_object_type( ) just drop the
table only. But when I find the triggers havn't
been actived yet, I add the delete setense. This time it becomes even
worse, the system throws error message.ERROR: could
not open relation with OID 1390714.
To avoid the fatal error, I have no choice but to rollback the function
to the original version.
I have written a simplified test cast to verify the system, but it
performs as I expected and it's wrong.
Once I remove the bare text from the test case, my 8.0b3 system seems to
run the whole thing pasted in with no errors. What version are you trying
it against?