[Qgis-user] Dissolve keeping all attributes values (concatenation/aggregation)?

celati Laurent laurent.celati at gmail.com
Tue Sep 30 10:02:23 PDT 2025


 Dear Chris,
Thank you. Indeed, You right.
But when i rerun the query with the edit (adding the closing parenthesis) :











*SELECT     min(union_v4.max_hierar) as id,     array_agg(union_v4.id
<http://union_v4.id>) as ids,     union_v6.geomFROM union_v4,    (SELECT
      (ST_Dump(St_multi(ST_Union(geom)))).geom as geom    FROM
union_v6)WHERE     st_intersects(union_v4.geom, union_v6.geom)GROUP BY
union_v6.geom*

I obtain this time the message :

ERROR: la relation « union_v4 » n'existe pas LINE 5: FROM union_v4, ^
ERREUR: la relation « union_v4 » n'existe pas SQL state: 42P01 Character:
105


However, i have one table called "union_v4" within my postgis db.
thanks so much.


Le mar. 30 sept. 2025 à 17:39, chris hermansen <clhermansen at gmail.com> a
écrit :

> Laurent and list,
>
>
> On Tue, Sep 30, 2025, 07:14 celati Laurent via QGIS-User <
> qgis-user at lists.osgeo.org> wrote:
>
>> Dear all,
>>
>> I work with qgis and postgis. I would like to perform a "dissolve":
>>
>> https://docs.qgis.org/3.40/en/docs/user_manual/processing_algs/qgis/vectorgeometry.html#dissolve
>>
>> in keeping/preserving  all attributes values ? For instance : a kind of
>> aggregation/concatenation within new "output features" ?
>>
>> I Saw this post :
>>
>>  https://www.aproposinfosystems.com/en/about/blog/managing-attributes-postgis-dissolve/
>> <https://www.aproposinfosystems.com/en/about/blog/managing-attributes-postgis-dissolve/>
>>
>> I have tried to reproduce the proposal with my postgis table containing
>> several polygons
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *SELECT min(union_v4.max_hierar) as id, array_agg(union_v4.id
>> <http://union_v4.id>) as ids, union_v6.geomFROM union_v4, (SELECT
>> (ST_Dump(St_multi(ST_Union(geom)))).geom as geom FROM union_v6WHERE
>> st_intersects(union_v4.geom, union_v6.geom)GROUP BY union_v6.geom*
>>
>> But i obtain :
>>
>>
>>
>>
>>
>>
>> *ERROR: syntax error at the end of the entryLINE 12: GROUP BY
>> union_v6.geom ^ERROR: syntax error at the end of the entrySQL state:
>> 42601Characters: 285*
>>
>
> I'm on my phone and squinting a bit here but aren't you missing a right
> parenthesis? Ending your correlated sub query?
>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20250930/e2d582ee/attachment.htm>


More information about the QGIS-User mailing list