seg
data type for representing line segments or floating-point intervals
seg : data type for representing line segments or floating-point intervals
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 3940 | seg | seg | 1.4 |
TYPE | PostgreSQL | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-dt- | No | Yes | No | Yes | no | yes |
Packages
| PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|
| 1.4 | 1.4 | 1.4 | 1.4 | 1.4 |
This is a built-in contrib extension ship with the PostgreSQL kernel
Install
Create this extension with:
Usage
The seg extension provides a data type for representing line segments or floating-point intervals, useful for representing measurements with uncertainty.
Input Formats
Certainty indicators (<, >, ~) can be prepended but are treated as comments and ignored by operators.
Operators
Spatial operators (GiST-indexed):
| Operator | Description |
|---|---|
<< |
Entirely left of |
>> |
Entirely right of |
&< |
Does not extend right of |
&> |
Does not extend left of |
= |
Equal |
&& |
Overlaps |
@> |
Contains |
<@ |
Contained in |
Comparison operators (<, <=, >, >=) are available for sorting.
Index Support
Precision
Values are stored as 32-bit floating-point pairs, retaining up to 7 significant digits. Trailing zeroes are preserved.