3 ms·
It's so you can't define two billings for the same period (say, the same month). To prevent you from double-billing someone. && is the range operator that chec
by waffle_ss 9y ago
It's so you can't define two billings for the same period (say, the same month). To prevent you from double-billing someone.
&& is the range operator that checks for overlap.[1]
You have to use gist indexes to do this. And in fact this page doesn't mention it but you have to enable the btree_gist extension with:
CREATE EXTENSION btree_gist;
before the snippet above will work.
[1]: https://www.postgresql.org/docs/current/static/functions-range.html#RANGE-OPERATORS-TABLE https://www.postgresql.org/docs/current/static/functions-ran...
- tokenizerrr 9y agoThey're very nifty, as you can use this to easily prevent all kinds of date range overlaps.