hi,try SELECT to_char(null::date, 'DD.MM.YYYY')::text or SELECT to_char(null::timestamp, 'DD.MM.YYYY')::text
should work.It is not possible to guess type of null without explicit cast.
Regards,Bartek