Dear users, I have run a SQL Select [1] in order to Dissolve the features in a PostGIS table using ST_Union. I can load the Select [1] result as a new layer in QGIS, but when I try to create a PostgreSQL View [2] for the Select [1], I get an error message: [ERROR: cannot change name of view column "geom" to "id". Would anyone give me a hint or direction to solve this problem?
[1] --CREATE OR REPLACE VIEW geointeligencia.vw_cpma_limites AS ( SELECT row_number() over() AS id, st_union(mue_cpma.geom)::geometry(MultiPolygon,4674) as geom FROM( SELECT * FROM geo.br_municipios_2021 WHERE NM_MUN IN ( 'Afonso Cunha', 'Água Doce do Maranhão', 'Alcântara', 'Aldeias Altas', 'Altamira do Maranhão' ) AND SIGLA IN('MA')) AS mue_cpma ); [2] CREATE OR REPLACE VIEW geointeligencia.vw_cpma_limites AS ( SELECT row_number() over() AS id, st_union(mue_cpma.geom)::geometry(MultiPolygon,4674) as geom FROM( SELECT * FROM geo.br_municipios_2021 WHERE NM_MUN IN ( 'Afonso Cunha', 'Água Doce do Maranhão', 'Alcântara', 'Aldeias Altas', 'Altamira do Maranhão' ) AND SIGLA IN('MA')) AS mue_cpma -- ########################################## *Julierme G Pinheiro* *SDI Expert & Geoprocessing Specialist* Phone: +55 61 99994-3569 Website: GIS <https://www.udemy.com/course/qgis-server-para-iniciantes-instalacao-e-configuracao/>
_______________________________________________ QGIS-User mailing list QGIS-User@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user