ST_NPoints — Returns the number of points (vertices) in a geometry.
integer ST_NPoints(geometry  g1);
Return the number of points in a geometry. Works for all geometries.
Miglioramento: nella versione 2.0.0 è stato introdotto il supporto per le superfici poliedriche.
                 
               | 
              |
| 
                 Prior to 1.3.4, this function crashes if used with geometries that contain CURVES. This is fixed in 1.3.4+  | 
            
            
 Questa funzione supporta il 3d e non distrugge gli z-index. 
            
 Questo metodo supporta le Curve e le Circular String. 
            
 Questa funzione supporta le Polyhedral Surface. 
SELECT ST_NPoints(ST_GeomFromText('LINESTRING(77.29 29.07,77.42 29.26,77.27 29.31,77.29 29.07)'));
--result
4
--Polygon in 3D space
SELECT ST_NPoints(ST_GeomFromEWKT('LINESTRING(77.29 29.07 1,77.42 29.26 0,77.27 29.31 -1,77.29 29.07 3)'))
--result
4