
March 25th, 2012, 02:46 AM
|
|
Contributing User
|
|
Join Date: Oct 2003
Location: Germany
|
|
In Postgres (note the s at the end, "Postgre" is not the short form of PostgreSQL), you have to define the check constraint at the end:
Code:
CREATE TABLE foo
(
startTime time not null,
endTime time check (endTime is null or endTime > startTime),
startDate date not null,
endDate date check (endDate is null or endDate > startDate)
)
|