Support for MOVE in PL/PgSQL. Initial patch from Magnus, some improvements

by Pavel Stehule, and reviewed by Neil Conway.
This commit is contained in:
Neil Conway
2007-04-29 01:21:09 +00:00
parent f2321a3f37
commit 8690ebc26f
8 changed files with 227 additions and 48 deletions

View File

@ -2511,4 +2511,27 @@ $$ language plpgsql;
select * from sc_test();
create or replace function sc_test() returns setof integer as $$
declare
c cursor for select * from generate_series(1, 10);
x integer;
begin
open c;
loop
move relative 2 in c;
if not found then
exit;
end if;
fetch next from c into x;
if found then
return next x;
end if;
end loop;
close c;
end;
$$ language plpgsql;
select * from sc_test();
drop function sc_test();