Re: function side effects - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: function side effects
Date
Msg-id 1267525580.20952.5.camel@fsopti579.F-Secure.com
Whole thread Raw
In response to Re: function side effects  (Jaime Casanova <jcasanov@systemguards.com.ec>)
List pgsql-hackers
On mån, 2010-03-01 at 15:30 -0500, Jaime Casanova wrote:
> so IMMUTABLE = DETERMINISTIC NO SQL,
> STABLE = DETERMINISTIC READS SQL DATA
> VOLATILE = NOT DETERMINISTIC MODIFIES SQL DATA

It might be tempting to create such a mapping, but there could be a
number of pitfalls, especially if you define it as a commutative
equivalence rather than say logical implications.  For example, MODIFIES
SQL DATA ought to imply VOLATILE, but the reverse is not true.

When the volatility attribute was introduced, we briefly looked at the
standard "deterministic" attribute, but concluded that it would be
better to create settings that describe how the PostgreSQL
planner/executor works instead of some abstract setting that is
descriptive but doesn't actually help optimizing the query.

We might actually end up with all three groups of settings at some
point.



pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: pg_stop_backup does not complete
Next
From: Peter Eisentraut
Date:
Subject: Re: function side effects