Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tu6m1-0005RT-Ld for pgsql-bugs@arkaria.postgresql.org; Sat, 12 Jan 2013 19:29:45 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Tu6m0-0004wn-Fy for pgsql-bugs@arkaria.postgresql.org; Sat, 12 Jan 2013 19:29:44 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tu6lz-0004wh-Jd for pgsql-bugs@postgresql.org; Sat, 12 Jan 2013 19:29:43 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tu6lx-0003uK-9J for pgsql-bugs@postgresql.org; Sat, 12 Jan 2013 19:29:43 +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 r0CJTcOU021643; Sat, 12 Jan 2013 14:29:38 -0500 (EST) From: Tom Lane To: "Kevin Grittner" cc: "Rodrigo Rosenfeld Rosas" , pgsql-bugs@postgresql.org Subject: Re: wrong search_path being used In-reply-to: <20130112185917.255770@gmx.com> References: <20130112185917.255770@gmx.com> Comments: In-reply-to "Kevin Grittner" message dated "Sat, 12 Jan 2013 13:59:17 -0500" Date: Sat, 12 Jan 2013 14:29:38 -0500 Message-ID: <21642.1358018978@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 "Kevin Grittner" writes: > To try to get your function code to work as you expect, the > language would essentially need to identify which statements could > be pre-planned, and which would needed to be treated as raw source > on each execution. That would be tricky to implement, and would > itself have some run-time cost. At this point we've put the burden > on the programmer to identify this at the time the code is written, > rather than adding run-time expense. 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. This wouldn't be that hard to implement but there's a definite risk of loss of performance due to unnecessary replanning (since the path change might or might not affect the particular query). It's also not unlikely that it could break applications that work today, because they depend -- perhaps without being aware of it -- on the existing first-path-wins behavior. Having said that, it seems likely that more people would prefer that behavior than the existing one. But it hasn't been clear enough to justify making such a subtly incompatible change. 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