pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: will@willglynn.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #11637: SQL function volatility is ignored on index creation
Date: Fri, 10 Oct 2014 13:58:36 -0400
Message-ID: <29554.1412963916@sss.pgh.pa.us> (raw)
In-Reply-To: <20141010171905.25462.4715@wrigleys.postgresql.org>
References: <20141010171905.25462.4715@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

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



view thread (3+ messages)  latest in thread

Message-ID: <29554.1412963916@sss.pgh.pa.us>
Permalink:  ../29554.1412963916@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/29554.1412963916@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, will@willglynn.com
  Subject: Re: BUG #11637: SQL function volatility is ignored on index creation
  In-Reply-To: <29554.1412963916@sss.pgh.pa.us>
  References: <20141010171905.25462.4715@wrigleys.postgresql.org> <29554.1412963916@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox