Consider a prices table with these columns:
id integer primary key
product_id integer -- foreign key
start_date date not null
end_date date not null
quantity integer
price numeric
I'd like the database to enforce the rule that a product can only have one price at a specific quantity in a date range (via where <date> BETWEEN start_date AND end_date).
Is this kind of range-based constraint doable?