1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-25 13:17:41 +03:00

Add PL/PgSQL FOUND and GET DIAGNOSTICS support for RETURN QUERY

statement

Pavel Stehule
This commit is contained in:
Bruce Momjian
2009-02-05 15:25:49 +00:00
parent 78cbd49826
commit 8c78f8e65c
4 changed files with 71 additions and 2 deletions

View File

@@ -2948,3 +2948,27 @@ $$ language plpgsql immutable strict;
select * from tftest(10);
drop function tftest(int);
create or replace function rttest()
returns setof int as $$
declare rc int;
begin
return query values(10),(20);
get diagnostics rc = row_count;
raise notice '% %', found, rc;
return query select * from (values(10),(20)) f(a) where false;
get diagnostics rc = row_count;
raise notice '% %', found, rc;
return query execute 'values(10),(20)';
get diagnostics rc = row_count;
raise notice '% %', found, rc;
return query execute 'select * from (values(10),(20)) f(a) where false';
get diagnostics rc = row_count;
raise notice '% %', found, rc;
end;
$$ language plpgsql;
select * from rttest();
drop function rttest();