Craig Ringer <craig@postnewspapers.com.au> writes:
> Is the search_path reset in some way that's not visible in
> pg_catalog.pg_settings when the ON DELETE CASCADE is issued?
No, I don't believe so. Perhaps your test case was simply fooled by
plan caching within the trigger function?
In general the solution to this type of problem is to attach a
search_path setting to any function that might be invoked via untrusted
users.
regards, tom lane