postgresql_16:9.6.39.5 Notes
PostgreSQL 16 > Appendixes > Additional Supplied Modules and Extensions > seg — a datatype for line segments or floating point intervals > Notes
For examples of usage, see the regression test sql/seg.sql.
The mechanism that converts (+-) to regular ranges isn't completely accurate in determining the number of significant digits for the boundaries. For example, it adds an extra digit to the lower boundary if the resulting interval includes a power of ten: postgres=> select '10(+-)1'::seg as seg; seg --------- 9.0 .. 11 -- should be: 9 .. 11
The performance of an R-tree index can largely depend on the initial order of input values. It may be very helpful to sort the input table on the seg column; see the script sort-segments.pl for an example.