postgresql_16:3.5.8.6 Polygons
PostgreSQL 16 > The SQL Language > Data Types > Geometric Types > Polygons
Polygons are represented by lists of points (the vertexes of the polygon). Polygons are very similar to closed paths; the essential semantic difference is that a polygon is considered to include the area within it, while a path is not.
An important implementation difference between polygons and paths is that the stored representation of a polygon includes its smallest bounding box. This speeds up certain search operations, although computing the bounding box adds overhead while constructing new polygons.
Values of type polygon are specified using any of the following syntaxes: ( ( *x1* , *y1* ) , ... , ( *xn* , *yn* ) ) ( *x1* , *y1* ) , ... , ( *xn* , *yn* ) ( *x1* , *y1* , ... , *xn* , *yn* ) *x1* , *y1* , ... , *xn* , *yn* where the points are the end points of the line segments comprising the boundary of the polygon.
Polygons are output using the first syntax.