Jeremy Cowgar <jeremy@cowgar.com> writes:
> I didn’t realize that pg_dump alters the search path. Couldn’t pg_dump
> simply append the default search path to the end of it’s custom setting?
There's no particularly good reason to believe that there's a single
"default" search_path that would apply to all usages in a given database.
Even if there were, sticking another schema in front of it wouldn't
produce the same results, ie if you have code that fails when the
search_path isn't "f, g, h", it may well fail when the search_path is
"g, f, g, h", because schema g would win ambiguous references over
schema f.
We could maybe make this work if pg_dump never touched the search_path
at all, but that would be a quite subtle change creating its own set of
hazards.
The long and the short of it is that code in CHECK constraints (or
triggers) is well advised not to depend on any particular search_path;
blaming pg_dump for exposing that is just shooting the messenger.
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs