I am working on postgis and was ran below query but i have my doubts
Is the below representation valid ?
As far as I know the polygon must have 4 coordinates.
SELECT ST_GeometryType ( ST_GeomFromGeoJSON('{
"type": "Polygon",
"coordinates": [
[
[
10.798460841178894,
27.7146573614866
],
[
18.005492091178894,
23.112072196617056
]
]
]
}'));
What can be work around for the validation ?
Can we throw error before insert in such case ?


ST_11DDistance... – geozelot Apr 10 '18 at 11:00