42#ifndef INTERVAL_UNION_H
43#define INTERVAL_UNION_H
45#if PG_VERSION_NUM >= 140000 || defined(DOXYGEN)
49#include "catalog/pg_type.h"
50#include "utils/fmgroids.h"
51#include "utils/multirangetypes.h"
52#include "utils/lsyscache.h"
90 if(v.empty())
return zero();
92 for(
size_t i = 1; i < v.size(); ++i)
93 r = OidFunctionCall2(F_MULTIRANGE_UNION, r, v[i]);
97 if(v.empty())
return one();
99 for(
size_t i = 1; i < v.size(); ++i)
100 r = OidFunctionCall2(F_MULTIRANGE_INTERSECT, r, v[i]);
105 return OidFunctionCall2(F_MULTIRANGE_MINUS, x, y);
Abstract semiring interface for provenance evaluation.
IntervalUnion(Oid multirange_oid)
virtual value_type zero() const override
Return the additive identity .
Datum parse_leaf(const char *str) const
Parse a multirange text literal to a Datum.
virtual value_type delta(value_type x) const override
Apply the operator.
virtual value_type plus(const std::vector< value_type > &v) const override
Apply the additive operation to a list of values.
virtual bool absorptive() const override
Return true if this semiring is absorptive ( for all ).
virtual value_type times(const std::vector< value_type > &v) const override
Apply the multiplicative operation to a list of values.
virtual bool compatibleWithBooleanRewrite() const override
A semiring homomorphism BoolFunc(Y) →+* IntervalUnion exists (map each variable to a fixed nonempty i...
virtual value_type one() const override
Return the multiplicative identity .
virtual value_type monus(value_type x, value_type y) const override
Apply the monus (m-semiring difference) operation.
Abstract base class for (m-)semirings.