Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d9Gug-00082c-4b for pgsql-bugs@arkaria.postgresql.org; Fri, 12 May 2017 20:11:46 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d9Guf-0003aZ-M8 for pgsql-bugs@arkaria.postgresql.org; Fri, 12 May 2017 20:11:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d9Gtx-0002CW-2h for pgsql-bugs@postgresql.org; Fri, 12 May 2017 20:11:01 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d9Gtt-0007Zy-Fk for pgsql-bugs@postgresql.org; Fri, 12 May 2017 20:11:00 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v4CKAp8a009063; Fri, 12 May 2017 16:10:51 -0400 From: Tom Lane To: Jeremy Cowgar cc: pgsql-bugs@postgresql.org Subject: Re: BUG #14649: Function Namespace Resolution Bug In-reply-to: <1F6612EB-9846-478A-A4C5-608439B05574@cowgar.com> References: <20170512174059.1791.21888@wrigleys.postgresql.org> <26979.1494612834@sss.pgh.pa.us> <5732.1494615050@sss.pgh.pa.us> <1F6612EB-9846-478A-A4C5-608439B05574@cowgar.com> Comments: In-reply-to Jeremy Cowgar message dated "Fri, 12 May 2017 15:16:49 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <9061.1494619851.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Fri, 12 May 2017 16:10:51 -0400 Message-ID: <9062.1494619851@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Jeremy Cowgar 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