martin/tests/fixtures/functions/function_null_row2.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

7 lines
273 B
PL/PgSQL

DROP FUNCTION IF EXISTS public.function_null_row2;
CREATE OR REPLACE FUNCTION public.function_null_row2(z integer, x integer, y integer)
RETURNS TABLE(mvt bytea, key text) AS $$
SELECT NULL::bytea, NULL::text WHERE FALSE;
$$ LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE;