Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TsIL9-00022S-5x for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Jan 2013 19:26:31 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TsIL8-0005VU-Mu for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Jan 2013 19:26:30 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TsIL8-0005VP-2p for pgsql-bugs@postgresql.org; Mon, 07 Jan 2013 19:26:30 +0000 Received: from mail-ie0-f172.google.com ([209.85.223.172]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TsIL6-0008KT-Ta for pgsql-bugs@postgresql.org; Mon, 07 Jan 2013 19:26:29 +0000 Received: by mail-ie0-f172.google.com with SMTP id c13so24564469ieb.3 for ; Mon, 07 Jan 2013 11:26:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=E0EwT2r+qG9wbD9DG9UuHHeXgc4OYrxznDZdikEWAuo=; b=nVyG+ue/eORPomMC2lJo1FjZ26TmoW17mvhV51F574X0QlFy14UvpxgdrUjnBpctHS QjRLrpblVxZ69huuePU1aydFXUZz75dMcv0THmNRtCIuG1mz3BZgwzC1dDTeT0uIs+hb w7JzBasf734HyEo8fvoptcVjHrDIJwC4R/ZywzlbWaraIdL8HlP3Iu3d0Noei25mlhws YDn+IrmJImh4AzxXUfSFSk/+ZQk42zBgy5eEwqhq+Q2ADJd8HP79PhuV0g/i5vMgchRW gDaoOFYTlimcCZJesfXdbK1GtcjVVyrXGqZYf4McARApxKyqWBhG8LWtJzzyvaYdGe9T tWIw== X-Received: by 10.50.33.212 with SMTP id t20mr6551968igi.108.1357586788511; Mon, 07 Jan 2013 11:26:28 -0800 (PST) Received: from [187.64.164.181] ([187.64.164.181]) by mx.google.com with ESMTPS id fv6sm7660025igc.17.2013.01.07.11.26.25 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 07 Jan 2013 11:26:27 -0800 (PST) Message-ID: <50EB2160.6060102@gmail.com> Date: Mon, 07 Jan 2013 17:26:24 -0200 From: Rodrigo Rosenfeld Rosas User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.11) Gecko/20121122 Icedove/10.0.11 MIME-Version: 1.0 To: Tom Lane CC: pgsql-bugs@postgresql.org Subject: Re: wrong search_path being used References: <50EB18E9.8020202@gmail.com> <14893.1357586247@sss.pgh.pa.us> In-Reply-To: <14893.1357586247@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) 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 Em 07-01-2013 17:17, Tom Lane escreveu: > 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. So, Tom, if I understand it correctly, you do consider it a bug but you don't want to backport a fix because it might break existent behavior in some dbs, right? But it is not clear to me if you're willing to fix it for 9.2.3 for instance? It is likely I'll be creating lots of functions to perform the same operations in different schemas as my application is being designed to handle multiple field templates using separate schemas and the application will switch what templates are used based on current_path but lots of database migrations (not sure if you know what I mean for that, but I'm using Rails web framework terminology here) will perform the same changes to the database for each of the supported schemas/templates. So, I'd really like this behavior to be fixed in future versions of PG if possible. What is your opinion on the subject? Thanks for the prompt answer! Cheers, Rodrigo. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs