Delete row in trigger (PostgreSQL)
I've got a trigger on update, that should delete the row OLD*, but I don't know the table structure. So I've tried using information_schema to grab columns names, but it's really slow.
Is it possible to perform the deletion without knowledge about table structure?
UPD: Trigger should accept row of any table, so trigger function cannot know anything about the table before it will be invoked.
UPD2:
This works well for me:EXECUTE 'DELETE FROM ' || tablename || ' WHERE ctid=$1' USIN开发者_开发百科G OLD.ctid;
精彩评论