Greg Stark <gsstark(at)mit(dot)edu> writes:
> Consider a query like
> select * from foo where a = currval('xyz') and b = nextval('xyz')
> ...
> Though actually I don't really see how any interpretation of this
> query really makes a whole lot of sense.
Yeah. The only moderately credible use-case I've ever seen for volatile
functions in WHERE clauses is
select * from foo where random() < 0.01;
which gets you a random sampling of approximately 1% of the table.
regards, tom lane