<div dir="ltr"><div>Dear Erik,</div><div>Thank you. <br></div><div>But when i rerun the query with the edit (adding the closing parenthesis) : </div><div><br><i><span style="background-color:rgb(204,204,204)">SELECT <br> min(union_v4.max_hierar) as id, <br> array_agg(<a href="http://union_v4.id">union_v4.id</a>) as ids, <br> union_v6.geom<br>FROM union_v4,<br> (SELECT <br> (ST_Dump(St_multi(ST_Union(geom)))).geom as geom<br> FROM union_v6)<br>WHERE <br> st_intersects(union_v4.geom, union_v6.geom)<br>GROUP BY union_v6.geom</span></i></div><div><br></div><div><i>I obtain this time the message : <br><span style="background-color:rgb(204,204,204)"><br></span></i>
<span style="color:rgb(34,34,34);font-family:"Source Code Pro",SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:12px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:0.14994px;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:pre-wrap;text-decoration-style:initial;text-decoration-color:initial;display:inline;float:none;background-color:rgb(204,204,204)">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</span><span style="background-color:rgb(204,204,204)"><br><br><br></span></div><div><span style="background-color:rgb(255,255,255)">However, i have one table called "union_v4" within my postgis db. <br></span></div><div><span style="background-color:rgb(255,255,255)">thanks so much.</span></div><div><br></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">Le mar. 30 sept. 2025 à 17:04, Erik Wienhold <<a href="mailto:ewie@ewie.name">ewie@ewie.name</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 2025-09-30 16:08 +0200, celati Laurent wrote:<br>
> I work with qgis and postgis. I would like to perform a "dissolve":<br>
> <a href="https://docs.qgis.org/3.40/en/docs/user_manual/processing_algs/qgis/vectorgeometry.html#dissolve" rel="noreferrer" target="_blank">https://docs.qgis.org/3.40/en/docs/user_manual/processing_algs/qgis/vectorgeometry.html#dissolve</a><br>
> <br>
> in keeping/preserving all attributes values ? For instance : a kind of<br>
> aggregation/concatenation within new "output features" ?<br>
> <br>
> I Saw this post :<br>
> <a href="https://www.aproposinfosystems.com/en/about/blog/managing-attributes-postgis-dissolve/" rel="noreferrer" target="_blank">https://www.aproposinfosystems.com/en/about/blog/managing-attributes-postgis-dissolve/</a><br>
> <br>
> I have tried to reproduce the proposal with my postgis table containing<br>
> several polygons<br>
> <br>
> *SELECT min(union_v4.max_hierar) as id, array_agg(<a href="http://union_v4.id" rel="noreferrer" target="_blank">union_v4.id</a><br>
> <<a href="http://union_v4.id" rel="noreferrer" target="_blank">http://union_v4.id</a>>) as ids, union_v6.geomFROM union_v4, (SELECT<br>
> (ST_Dump(St_multi(ST_Union(geom)))).geom as geom FROM union_v6WHERE<br>
> st_intersects(union_v4.geom, union_v6.geom)GROUP BY union_v6.geom*<br>
> <br>
> But i obtain :<br>
> <br>
> *ERROR: syntax error at the end of the entryLINE 12: GROUP BY union_v6.geom<br>
> ^ERROR: syntax error at the end of the entrySQL state: 42601Characters: 285*<br>
<br>
Your query is missing the closing parenthesis of the union_v6 subquery<br>
(after "FROM union_v6"). This should work:<br>
<br>
SELECT<br>
min(union_v4.max_hierar) as id,<br>
array_agg(<a href="http://union_v4.id" rel="noreferrer" target="_blank">union_v4.id</a>) as ids,<br>
union_v6.geom<br>
FROM union_v4,<br>
(SELECT<br>
(ST_Dump(St_multi(ST_Union(geom)))).geom as geom<br>
FROM union_v6) union_v6<br>
WHERE st_intersects(union_v4.geom, union_v6.geom)<br>
GROUP BY union_v6.geom;<br>
<br>
-- <br>
Erik Wienhold<br>
</blockquote></div>