Here is a patch against 7.0.2 that fixes the bug where casting a NULL returned from a select to type date fails with the error: Unable to convert null timestamp to date
pgsql-patches by date:
Соглашаюсь с условиями обработки персональных данных