"Joel Burton" <jburton@scw.org> writes:
>> If foo() is marked cachable then it's evaluated once during query
>> planning; if not it's evaluated again for each row scanned in table1.
> Sounds reasonable. But does it work as advertised?
Yes, it does. You're still not trying it on multiple tuples.
regards, tom lane