I have 23 tables in a PostGIS schema which I need to count the number of vertices of. The tables are a mixture of lines and polygons so realised I need to use ST_NPoints(geom)
So I ran the following query
SELECT count(ST_NPoints(geom) FROM lines;
the result/count equals the number of features in that table and not the total number of vertices of all features in that table.
I must be missing something but cannot figure it out (must be monday morning ;))