mirror of
https://github.com/postgres/postgres.git
synced 2025-07-26 01:22:12 +03:00
Here's a patch to do the following:
1. Rename spi_return_next to return_next. 2. Add a new test for return_next. 3. Update the expected output. 4. Update the documentation. Abhijit Menon-Sen
This commit is contained in:
@ -234,3 +234,16 @@ $$ LANGUAGE plperl;
|
||||
SELECT perl_get_field((11,12), 'x');
|
||||
SELECT perl_get_field((11,12), 'y');
|
||||
SELECT perl_get_field((11,12), 'z');
|
||||
|
||||
--
|
||||
-- Test return_next
|
||||
--
|
||||
|
||||
CREATE OR REPLACE FUNCTION perl_srf_rn() RETURNS SETOF RECORD AS $$
|
||||
$i = 0;
|
||||
for ("World", "PostgreSQL", "PL/Perl") {
|
||||
return_next({f1=>++$i, f2=>'Hello', f3=>$_});
|
||||
}
|
||||
return;
|
||||
$$ language plperl;
|
||||
SELECT * from perl_srf_rn() AS (f1 INTEGER, f2 TEXT, f3 TEXT);
|
||||
|
Reference in New Issue
Block a user