Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XceSt-0007yc-DD for pgsql-bugs@arkaria.postgresql.org; Fri, 10 Oct 2014 17:58:55 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XceSq-0007y3-W4 for pgsql-bugs@arkaria.postgresql.org; Fri, 10 Oct 2014 17:58:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XceSj-0007i7-He for pgsql-bugs@postgresql.org; Fri, 10 Oct 2014 17:58:45 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XceSc-0001LH-OF for pgsql-bugs@postgresql.org; Fri, 10 Oct 2014 17:58:41 +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 s9AHwa5m029555; Fri, 10 Oct 2014 13:58:36 -0400 From: Tom Lane To: will@willglynn.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #11637: SQL function volatility is ignored on index creation In-reply-to: <20141010171905.25462.4715@wrigleys.postgresql.org> References: <20141010171905.25462.4715@wrigleys.postgresql.org> Comments: In-reply-to will@willglynn.com message dated "Fri, 10 Oct 2014 17:19:05 -0000" Date: Fri, 10 Oct 2014 13:58:36 -0400 Message-ID: <29554.1412963916@sss.pgh.pa.us> X-Pg-Spam-Score: -2.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 will@willglynn.com writes: > The CREATE INDEX documentation and the wording of that error message > strongly imply that it's a function's volatility *marking* that is > important, but in at least some situations, PostgreSQL ignores > pg_proc.provolatile='v' and allows index creation anyway if the function is > in fact immutable. I suspect this qualifier is ignored because the SQL > function call is being inlined prior to the CheckMutability() in > ComputeIndexAttrs(); there isn't a volatile function call, just an immutable > expression. That's correct, and it's intentional behavior, not a bug (cf commit 5a86e5e1930d95f495a134000512d6ca22064338). Refusing the CREATE would just be pedantry AFAICS. 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