I'm planning on trying out a version of the check done for foreign keys that does a query on the fktable with a NOT EXISTS subselect rather than the current run the trigger for each row (thus doing one query per row of the table). I want to see if this tends to be faster than what we're doing now and want to make sure noone has any general objections to doing it this way (before bothering to do it and timings).
---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster