Add a trigger function to simulate FKEY constraints on inherited tables