I have an update trigger that should delete the OLD * row, but I don't know the table structure. So I tried using information_schema to grab column names, but it is very slow.
Is it possible to perform a deletion without knowing the structure of the tables?
UPD: A
trigger must accept a row in any table, so the trigger function cannot know anything about a table before calling it.
UPD2:
This works well for me:
EXECUTE 'DELETE FROM ' || tablename || ' WHERE ctid=$1' USING OLD.ctid;
source
share