public inbox for [email protected]  
help / color / mirror / Atom feed
From: PG Doc comments form <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: Nit: "Immutable" should be "pure"
Date: Thu, 07 Nov 2019 14:17:58 +0000
Message-ID: <[email protected]> (raw)

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/12/sql-createindex.html
Description:

The adjective "immutable" describing the functions and operators used in an
index (see two occurrences in doc snippet below) is incorrect and should be
replaced with "pure". Both "pure" and "immutable" are in popular lexicon now
because of the interest in functional programming, so conflating the two can
happen, but the word immutable applies to data and pure applies to
functions. See https://en.wikipedia.org/wiki/Pure_function. 

From the CREATE INDEX doc:
All functions and operators used in an index definition must be “immutable”,
that is, their results must depend only on their arguments and never on any
outside influence (such as the contents of another table or the current
time). This restriction ensures that the behavior of the index is
well-defined. To use a user-defined function in an index expression or WHERE
clause, remember to mark the function immutable when you create it.


view thread (4+ messages)  latest in thread

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Nit: "Immutable" should be "pure"
  In-Reply-To: <[email protected]>

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

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