Re: BUG #6551: PL/pgSQL: GET DIAGNOSTICS not working for first OUT parameter

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: <aburacze(at)gmail(dot)com>,<pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #6551: PL/pgSQL: GET DIAGNOSTICS not working for first OUT parameter
Date: 2012-03-22 17:53:01
Message-ID: 4F6B20AD02000025000465F5@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

<aburacze(at)gmail(dot)com> wrote:

> x1 | x2 | x3
> ----+----+----
> | 1 | 1

To reduce the ambiguity about what value is coming from where, I
slightly modified the script before testing it against a recent HEAD
build:

create table t (c integer);

create function p(out x1 integer, out x2 integer, out x3 integer)
as $$
begin
insert into t values (1),(2);
get diagnostics x1 = row_count;
insert into t values (3),(4),(5);
get diagnostics x2 = row_count;
insert into t values (6),(7),(8),(9),(10);
get diagnostics x3 = row_count;
end;
$$ language plpgsql;

select * from p();

I got this:

x1 | x2 | x3
----+----+----
| 3 | 5
(1 row)

-Kevin

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2012-03-22 17:57:02 Re: BUG #6551: PL/pgSQL: GET DIAGNOSTICS not working for first OUT parameter
Previous Message aburacze 2012-03-22 17:38:00 BUG #6551: PL/pgSQL: GET DIAGNOSTICS not working for first OUT parameter