Temp workaround for postgres timestamp issue when using function ifnull