ST_Points — Returns a MultiPoint containing all the coordinates of a geometry.
Returns a MultiPoint containing all of the coordinates of a geometry. Does not remove points that are duplicated in the input geometry, including start and end points of ring geometries. (If this behavior is undesired, duplicates may be removed using ST_RemoveRepeatedPoints).
M and Z coordinates will be preserved if present.
This method supports Circular Strings and Curves
This function supports 3d and will not drop the z-index.
SELECT ST_AsText(ST_Points('POLYGON Z ((30 10 4,10 30 5,40 40 6, 30 10))')); --result MULTIPOINT Z (30 10 4,10 30 5,40 40 6, 30 10 4)