I am working with a "cities" layer (polygons) in a PostgreSQL 9.1 database. When I use the following query in PostGIS:
select st_buffer(st_union(st_centroid(cities.geom)),1500) geom from "my_layer" cities
I have no problem with displaying the layer in QGIS.
When I use this syntax:
select st_union(st_buffer(st_centroid(cities.geom),1500)) geom from "my_layer" cities
No error is generated in PostGIS, the generated table has one element (as expected) the table can be opened in qgis, its extent "seems" OK but nothing appears on the screen ...
I checked objects with a ST_IsValid query and found no error. I tried adding an id but nothing changed. I tried these two queries in PostgreSQL 9.5 and had no problem at all.
What could I be doing wrong, why do I have this behavior using PostgreSQL 9.1, and what could be the workaround?
PS : PostGIS version is 1.5.3 in the first case (PostgreSQL 9.1) and 2.2.1 in the second case (I suppose it must be important ...)