Hello, Restoring from pg_dump fails if you have a table with expression based index where a stored function calls another function. Ex. SQL with steps to reproduce: https://pastebin.com/raw/CFgxtwSY
Workaround: Removing "SELECT pg_catalog.set_config('search_path', '', false);" from the sql dump.
This isn't a bug. Your workaround is perfectly acceptable for an end-user to attempt should they wish but it isn't something the project is going to entertain - though I seem to recall a discussion of at least giving the user control by adding a command line argument (as I mentioned before at [1] but still cannot find the original thread).
An obvious failure to restore a backup is not going to win out in a security risk comparison with being able to silently cause a privileged user to execute problem code.