Re: DETERMINISTIC as synonym for IMMUTABLE - Mailing list pgsql-hackers

From Tom Lane
Subject Re: DETERMINISTIC as synonym for IMMUTABLE
Date
Msg-id 26281.1098225064@sss.pgh.pa.us
Whole thread Raw
In response to Re: DETERMINISTIC as synonym for IMMUTABLE  ("Simon Riggs" <simon@2ndquadrant.com>)
List pgsql-hackers
"Simon Riggs" <simon@2ndquadrant.com> writes:
> AFAICS, your info shows that the standard's definition of DETERMINISTIC is
> confusing and contradictory. Most people's interpretation would be that
> DETERMINISTIC was the same as IMMUTABLE, so we should make the former a
> synonym for the latter and document the possible difference of
> interpretation. Seriously, if you can't put a blade of grass between them
> then they're OK to be equated.

The problem is that you *can* put a blade of grass between them, and
sooner or later we may wish to make the distinction.  In particular
I can think of optimization possibilities that rely on being able to
identify a function as being a pure function of the database state.
(This would mostly come into play if we ever try to support function
result caching; we don't now, but certainly it's been asked for often
enough.)  If we equate DETERMINISTIC with IMMUTABLE then we won't be
able to use DETERMINISTIC to describe cache-able functions.

Troels's later followup says that SQL2003 has redefined DETERMINISTIC
to in fact mean IMMUTABLE; if so I suppose we'll have to go with the
flow.  I have not looked closely at that version to see if I agree with
his reading.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Simon Riggs"
Date:
Subject: Re: plans for bitmap indexes?
Next
From: Andrew Dunstan
Date:
Subject: Re: tsearch2 windows make failure