Brandon Craig Rhodes <brandon@oit.gatech.edu> writes:
> But this same table suddenly becomes unwilling to use an index scan if
> the target value is the result of the currval() function:
currval() is considered a volatile function, therefore it is unsafe to
use in an indexscan constraint.
The subselect hack mentioned nearby fools the planner ... at the moment.
I wouldn't guarantee that it will work indefinitely. A better solution
is to wrap currval() in a function that you lyingly claim is stable.
regards, tom lane