Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TsICR-0001t5-BZ for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Jan 2013 19:17:31 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TsICQ-0001Vf-ST for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Jan 2013 19:17:30 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TsICQ-0001Va-9D for pgsql-bugs@postgresql.org; Mon, 07 Jan 2013 19:17:30 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TsICO-0008B3-VQ for pgsql-bugs@postgresql.org; Mon, 07 Jan 2013 19:17:29 +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 r07JHRnf014894; Mon, 7 Jan 2013 14:17:28 -0500 (EST) From: Tom Lane To: Rodrigo Rosenfeld Rosas cc: pgsql-bugs@postgresql.org Subject: Re: wrong search_path being used In-reply-to: <50EB18E9.8020202@gmail.com> References: <50EB18E9.8020202@gmail.com> Comments: In-reply-to Rodrigo Rosenfeld Rosas message dated "Mon, 07 Jan 2013 16:50:17 -0200" Date: Mon, 07 Jan 2013 14:17:27 -0500 Message-ID: <14893.1357586247@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 Rodrigo Rosenfeld Rosas writes: > perform pg_catalog.set_config('search_path', templ, true); > ... > select count(distinct transaction_id) from public.transaction_condition > into temp_count; > raise notice '% remaining transactions in public!', temp_count; > select count(distinct transaction_id) from transaction_condition into > temp_count; If this is inside a plpgsql function that's been executed more than once, the SELECTs would have plans that were cached the first time around, so that what would matter is the search_path that prevailed during the first execution. There have been discussions about changing that but we wouldn't treat it as a back-patchable bug fix, because it would almost certainly break things for somebody. 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