Sebastian Ritter написа:
Hi all,
I have a question regarding functions. How can I return zero rows from a
function whose return type is a table row? I did the following test and it
did not work as expected:
[...]
CREATE OR REPLACE FUNCTION foobar(boolean) RETURNS SETOF x AS $_$
DECLARE
res x%ROWTYPE;
BEGIN
if $1 THEN
RETURN NEXT res;
ELSE
RETURN;
END IF;
END;$_$
LANGUAGE plpgsql;
--
Milen A. Radev
---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at
http://www.postgresql.org/about/donate