begin;
create table foo(id integer);
create function f1() returns void language sql as $$delete from foo;$$;
create function f2() returns void language plpgsql as $$begin delete from foo; end;$$;
select f1() is null, pg_typeof(f1()), f1()::text, f1()::text is null;
/*
?column? | pg_typeof | f1 | ?column?
----------+-----------+----+----------
t | void | | t <----------------------the return is null
*/
select f2() is null, pg_typeof(f2()), f2()::text, f2()::text='';
/*
?column? | pg_typeof | f2 | ?column?
----------+-----------+----+----------
f | void | | t <----------------------the return is not null
*/
rollback;
Is this a documented inconsistency?
SQLFiddle here