Re: PL/PgSQL: stmt_fors and variable value after loop - Mailing list pgsql-docs

From Marko Tiikkaja
Subject Re: PL/PgSQL: stmt_fors and variable value after loop
Date
Msg-id 54BD3AA3.1020107@joh.to
Whole thread Raw
In response to Re: PL/PgSQL: stmt_fors and variable value after loop  (Marko Tiikkaja <marko@joh.to>)
List pgsql-docs
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


pgsql-docs by date:

Previous
From: Marko Tiikkaja
Date:
Subject: Re: PL/PgSQL: stmt_fors and variable value after loop
Next
From: Marko Tiikkaja
Date:
Subject: [DOCS] PL/PgSQL: stmt_fors and variable value after loop