makepolygon - Linestring exterior XY
:memory: #use in-memory database
SELECT ST_AsText(MakePolygon(GeomFromText('LINESTRING(1 1, 1 2, 2 2, 2 1, 1 1)', 4326)));
1 # rows (not including the header row)
1 # columns
ST_AsText(MakePolygon(GeomFromText('LINESTRING(1 1, 1 2, 2 2, 2 1, 1 1)', 4326)))
POLYGON((1 1, 1 2, 2 2, 2 1, 1 1))