FWIW, I went with this method:
On 1/19/15 5:17 PM, I wrote:
> 3) Use a count(*) OVER () inside the query and EXIT if that count is 1
I guess defining this behavior wouldn't be such a big win, since the
approach I showed would only work if the loop body keeps a count of the
number of iterations somewhere; FOR doesn't appear to be setting
row_count. I'm having a hard time imagining actual use cases where the
count doesn't matter but you'd like to look at the last values anyway.
If you think there's any chance that this would prevent us from changing
the implementation for the better in the future, I think we should just
drop this issue.
.marko
--
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs