I’m trying to get multiple clauses in one check constraint, separated by an OR:
check (stop>start or stop = NULL)
where start and stop are timestamp fields. So, stop can be left empty, but if it’s specified, it has to be later than start.
Am I getting this entirely wrong? I haven’t found anything on timestamp comparisons or if OR is allowed in check constraints.
This is in postgres 8.4.8.
You should use
stop IS NULL, notstop = NULL.