*** pgsql/src/pl/plperl/expected/plperl.out 2009/02/19 10:33:17 1.15 --- pgsql/src/pl/plperl/expected/plperl.out 2009/09/16 06:06:12 1.16 *************** CREATE OR REPLACE FUNCTION perl_set() RE *** 122,129 **** --- 122,131 ---- $$ LANGUAGE plperl; SELECT perl_set(); ERROR: SETOF-composite-returning PL/Perl function must call return_next with reference to hash + CONTEXT: PL/Perl function "perl_set" SELECT * FROM perl_set(); ERROR: SETOF-composite-returning PL/Perl function must call return_next with reference to hash + CONTEXT: PL/Perl function "perl_set" CREATE OR REPLACE FUNCTION perl_set() RETURNS SETOF testrowperl AS $$ return [ { f1 => 1, f2 => 'Hello', f3 => 'World' }, *************** CREATE OR REPLACE FUNCTION perl_record() *** 171,176 **** --- 173,179 ---- $$ LANGUAGE plperl; SELECT perl_record(); ERROR: function returning record called in context that cannot accept type record + CONTEXT: PL/Perl function "perl_record" SELECT * FROM perl_record(); ERROR: a column definition list is required for functions returning "record" LINE 1: SELECT * FROM perl_record(); *************** CREATE OR REPLACE FUNCTION perl_record_s *** 186,191 **** --- 189,195 ---- $$ LANGUAGE plperl; SELECT perl_record_set(); ERROR: set-valued function called in context that cannot accept a set + CONTEXT: PL/Perl function "perl_record_set" SELECT * FROM perl_record_set(); ERROR: a column definition list is required for functions returning "record" LINE 1: SELECT * FROM perl_record_set(); *************** CREATE OR REPLACE FUNCTION perl_record_s *** 204,215 **** --- 208,221 ---- $$ LANGUAGE plperl; SELECT perl_record_set(); ERROR: set-valued function called in context that cannot accept a set + CONTEXT: PL/Perl function "perl_record_set" SELECT * FROM perl_record_set(); ERROR: a column definition list is required for functions returning "record" LINE 1: SELECT * FROM perl_record_set(); ^ SELECT * FROM perl_record_set() AS (f1 integer, f2 text, f3 text); ERROR: SETOF-composite-returning PL/Perl function must call return_next with reference to hash + CONTEXT: PL/Perl function "perl_record_set" CREATE OR REPLACE FUNCTION perl_record_set() RETURNS SETOF record AS $$ return [ { f1 => 1, f2 => 'Hello', f3 => 'World' }, *************** CREATE OR REPLACE FUNCTION perl_record_s *** 219,224 **** --- 225,231 ---- $$ LANGUAGE plperl; SELECT perl_record_set(); ERROR: set-valued function called in context that cannot accept a set + CONTEXT: PL/Perl function "perl_record_set" SELECT * FROM perl_record_set(); ERROR: a column definition list is required for functions returning "record" LINE 1: SELECT * FROM perl_record_set(); *************** CREATE OR REPLACE FUNCTION foo_bad() RET *** 308,318 **** --- 315,327 ---- $$ LANGUAGE plperl; SELECT * FROM foo_bad(); ERROR: Perl hash contains nonexistent column "z" + CONTEXT: PL/Perl function "foo_bad" CREATE OR REPLACE FUNCTION foo_bad() RETURNS footype AS $$ return 42; $$ LANGUAGE plperl; SELECT * FROM foo_bad(); ERROR: composite-returning PL/Perl function must return reference to hash + CONTEXT: PL/Perl function "foo_bad" CREATE OR REPLACE FUNCTION foo_bad() RETURNS footype AS $$ return [ [1, 2], *************** return [ *** 321,336 **** --- 330,348 ---- $$ LANGUAGE plperl; SELECT * FROM foo_bad(); ERROR: composite-returning PL/Perl function must return reference to hash + CONTEXT: PL/Perl function "foo_bad" CREATE OR REPLACE FUNCTION foo_set_bad() RETURNS SETOF footype AS $$ return 42; $$ LANGUAGE plperl; SELECT * FROM foo_set_bad(); ERROR: set-returning PL/Perl function must return reference to array or use return_next + CONTEXT: PL/Perl function "foo_set_bad" CREATE OR REPLACE FUNCTION foo_set_bad() RETURNS SETOF footype AS $$ return {y => 3, z => 4}; $$ LANGUAGE plperl; SELECT * FROM foo_set_bad(); ERROR: set-returning PL/Perl function must return reference to array or use return_next + CONTEXT: PL/Perl function "foo_set_bad" CREATE OR REPLACE FUNCTION foo_set_bad() RETURNS SETOF footype AS $$ return [ [1, 2], *************** return [ *** 339,344 **** --- 351,357 ---- $$ LANGUAGE plperl; SELECT * FROM foo_set_bad(); ERROR: SETOF-composite-returning PL/Perl function must call return_next with reference to hash + CONTEXT: PL/Perl function "foo_set_bad" CREATE OR REPLACE FUNCTION foo_set_bad() RETURNS SETOF footype AS $$ return [ {y => 3, z => 4} *************** return [ *** 346,351 **** --- 359,365 ---- $$ LANGUAGE plperl; SELECT * FROM foo_set_bad(); ERROR: Perl hash contains nonexistent column "z" + CONTEXT: PL/Perl function "foo_set_bad" -- -- Check passing a tuple argument -- *************** CREATE OR REPLACE FUNCTION perl_spi_prep *** 539,542 **** return $result; $$ LANGUAGE plperl; SELECT perl_spi_prepared_bad(4.35) as "double precision"; ! ERROR: error from Perl function "perl_spi_prepared_bad": type "does_not_exist" does not exist at line 2. --- 553,557 ---- return $result; $$ LANGUAGE plperl; SELECT perl_spi_prepared_bad(4.35) as "double precision"; ! ERROR: type "does_not_exist" does not exist at line 2. ! CONTEXT: PL/Perl function "perl_spi_prepared_bad"