Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tu7St-0006iu-9r for pgsql-bugs@arkaria.postgresql.org; Sat, 12 Jan 2013 20:14:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Tu7Ss-00081V-3K for pgsql-bugs@arkaria.postgresql.org; Sat, 12 Jan 2013 20:14:02 +0000 Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tu7Sr-00081P-9d for pgsql-bugs@postgresql.org; Sat, 12 Jan 2013 20:14:01 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tu7Sn-0000Fm-20 for pgsql-bugs@postgresql.org; Sat, 12 Jan 2013 20:14:00 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id r0CKDpAE022442; Sat, 12 Jan 2013 15:13:51 -0500 (EST) From: Tom Lane To: Andres Freund cc: Kevin Grittner , Rodrigo Rosenfeld Rosas , pgsql-bugs@postgresql.org Subject: Re: wrong search_path being used In-reply-to: <20130112193906.GC21523@awork2.anarazel.de> References: <20130112185917.255770@gmx.com> <21642.1358018978@sss.pgh.pa.us> <20130112193906.GC21523@awork2.anarazel.de> Comments: In-reply-to Andres Freund message dated "Sat, 12 Jan 2013 20:39:06 +0100" Date: Sat, 12 Jan 2013 15:13:51 -0500 Message-ID: <22441.1358021631@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 Andres Freund writes: > On 2013-01-12 14:29:38 -0500, Tom Lane wrote: >> I think that the alternative most likely to succeed is to consider any >> change in the active value of search_path as forcing replanning of >> cached plans. > I guess it wouldn't really be feasible to keep the search path used to > plan a query in its cached form and check that it fits the one currently > used on every use of the cached plan? Actually that's exactly what I meant: every time we arrive at a query with a cached plan, check to see if the active search_path value is the same as what it was when we made the cached plan, and replan if not. There's already infrastructure to save the search_path value for a plan, but what it's being used for right now is to restore the first-plan-time value of the path when a replan is forced for some other reason. It wouldn't be that hard to change it around to use it this way instead. 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