I have a 1282 buildings as 14684 polygonz surfaces in Postgis. I want to create grid on these surfaces. So, for this purpose I need to extract vertex points for every polygonz geometry in database. To access database I am using pyscopg2 adapter of postgresql.

How can I extract vertex coordinates from polygons? Because I will use these points to create new ones on these surfaces