|Subject||Re: Strange behavior in stored procedure|
--- In email@example.com, Helen Borrie <helebor@...> wrote:
> The problem here is that there is only one row output from SELECTThanks Helen. I've modified the SP accordingly.
> FIRST so your FOR loop is going to return zilch whenever the output
> has multiple rows. Don't use SELECT FIRST in PSQL! Even when it
> returns the "expected" result, it's unnecessarily noisy. PSQL can
> get your one row (or any n rows) much more efficiently: