When I load a polygon shp file into QGIS 3.6 and run a query finding the centroids of the polygons, I cannot load it back to the layers panel. The same operation works fine in QGIS 2.18.2.
The query looks like this:
select id, st_centroid(geometry) as geom
from polygon_table
My main intention is to do the same operation in PyQGIS-3, and automate this process by allowing the user to choose the shp file from a GUI and load both the polygons as well as their centroids simultaneously.