3

Reading this post, the author references a "non-volatile" expression, after researching a bit, I'm still not sure what it is. What is meant by a non-volatile expression in Postgresql?

Nona
  • 277
  • 1
  • 3
  • 8

1 Answers1

5

"Immutable" expressions resolve to the same value always. Like 2 + 3.

"Stable" expressions resolve to the same value within a single table scan. Like: now().

"Volatile" expressions can resolve to a different value for each evaluation. Like: clock_timestamp().

"Non-volatile" would be in one of the first two categories.

Related:

Erwin Brandstetter
  • 185,527
  • 28
  • 463
  • 633