From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jeremy Cowgar <jeremy@cowgar.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #14649: Function Namespace Resolution Bug
Date: Fri, 12 May 2017 16:10:51 -0400
Message-ID: <9062.1494619851@sss.pgh.pa.us> (raw)
In-Reply-To: <1F6612EB-9846-478A-A4C5-608439B05574@cowgar.com>
References: <20170512174059.1791.21888@wrigleys.postgresql.org>
<26979.1494612834@sss.pgh.pa.us>
<C85A4615-B255-4D73-B0E2-774980C542A8@cowgar.com>
<5732.1494615050@sss.pgh.pa.us>
<1F6612EB-9846-478A-A4C5-608439B05574@cowgar.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, jeremy@cowgar.com
Subject: Re: BUG #14649: Function Namespace Resolution Bug
In-Reply-To: <9062.1494619851@sss.pgh.pa.us>
References: <20170512174059.1791.21888@wrigleys.postgresql.org> <26979.1494612834@sss.pgh.pa.us> <C85A4615-B255-4D73-B0E2-774980C542A8@cowgar.com> <5732.1494615050@sss.pgh.pa.us> <1F6612EB-9846-478A-A4C5-608439B05574@cowgar.com> <9062.1494619851@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox