This works: PREPARE is_date_reached AS SELECT NOW() < $1 OR $1 IS NULL;
However JDBC can not use the same parameter more than once… SELECT NOW() < ? OR ? IS NULL;
Hmm. That's not good.
How about:
SELECT NOW() < ? OR $1 IS NULL;
I've at least always managed to use the same parameters over again like that in JDBC under normal circumstances, thought that's been with types the driver knew about.