Hannu Krosing <hannu(at)tm(dot)ee> writes:
> Why is assuming a constant currval any more "invalid" than not doing so ?
Because it's wrong: it changes the behavior from what happens if the
optimizer does not do anything special with the function.
The fact that some cases involving currval+nextval (but not all) yield
unpredictable results is not an adequate argument for causing the
behavior of other cases to change. Especially not when there's a
perfectly good way for you to make it do what you want...
regards, tom lane