What is the difference between "ALTER DATABASE mydb SET search_path" and "SET search_path"?
ALTER DATABASE will change the search_path for every new connection to that database. The change however does not affect current connections - including the one that ran the ALTER DATABASE. The set search_path then changes the path also for the current connection so that it has the same value as the default path.