martin/tests/fixtures/functions/function_null.sql
Yuri Astrakhan 9efa364eb0
Fix handling for null-returning PG queries (#521)
Handle cases when a query returns a NULL or a table with no rows, or a
single row with a null value in it.

This fully fixes #519 in the main branch
2022-12-15 14:12:55 +02:00

8 lines
227 B
PL/PgSQL

DROP FUNCTION IF EXISTS public.function_null;
CREATE OR REPLACE FUNCTION public.function_null(z integer, x integer, y integer) RETURNS bytea AS $$
BEGIN
RETURN null;
END
$$ LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE;