abura...@gmail.com writes:
> I have just found strange behaviour of PL/pgSQL in case of using OUT
> parameters and GET DIAGNOSTICS var = ROW_COUNT (PostgreSQL 9.1.3). Here is a
> self-contained example:

Wow, that's been broken since the beginning, apparently.  There's an
entirely bogus test in exec_stmt_getdiag():

                if (diag_item->target <= 0)
                        continue;

It's not clear what the point of this is, since there is no case in
which the target variable should be invalid, but in any case the effect
is to ignore attempts to assign to any variable with dno zero --- which
will be the one first defined in the function, eg the first parameter
if any.  I guess I can see how this escaped detection for a long time,
but it's broken for sure.  Thanks for the report!

                        regards, tom lane

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Reply via email to