Set all null fields to NULL:
After this, the query results look like this:
select 'test' as test_text, null as test_null; test_text | test_null -----------+----------- test | NULL (1 row)
After this, the query results look like this:
select 'test' as test_text, null as test_null; test_text | test_null -----------+----------- test | NULL (1 row)