Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTzc5-00079H-Rd for pgsql-performance@arkaria.postgresql.org; Wed, 18 Jan 2017 23:25:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cTzc5-0001cu-4y for pgsql-performance@arkaria.postgresql.org; Wed, 18 Jan 2017 23:25:57 +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 1cTzc4-0001ce-Lm for pgsql-performance@postgresql.org; Wed, 18 Jan 2017 23:25:56 +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 1cTzc1-0003db-QK for pgsql-performance@postgresql.org; Wed, 18 Jan 2017 23:25:56 +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 v0INPfw9016253; Wed, 18 Jan 2017 18:25:41 -0500 From: Tom Lane To: Karl Czajkowski cc: pgsql-performance@postgresql.org Subject: Re: optimizing immutable vs. stable function calls? In-reply-to: <20170118230646.GD23081@moraine.isi.edu> References: <20170118223633.GC23081@moraine.isi.edu> <14964.1484780049@sss.pgh.pa.us> <20170118230646.GD23081@moraine.isi.edu> Comments: In-reply-to Karl Czajkowski message dated "Wed, 18 Jan 2017 15:06:46 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <16251.1484781941.1@sss.pgh.pa.us> Date: Wed, 18 Jan 2017 18:25:41 -0500 Message-ID: <16252.1484781941@sss.pgh.pa.us> X-Pg-Spam-Score: -5.1 (-----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org Karl Czajkowski writes: > Is there a correctness hazard with pretending our function is > IMMUTABLE, even though we will change the underlying config parameter > in the same connection? You could probably get away with that if you never ever use prepared queries (beware that almost anything in plpgsql is a prepared query). It's a trick that's likely to bite you eventually though. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance