[postgis-users] (no subject)

Nicolas Ribot nicky666 at gmail.com
Wed Aug 23 03:36:58 PDT 2023


Hello,

Yes you can by creating a view using UNION ALL (or UNION if you want to
filter out duplicate lines) between tables you want to use, for instance:

create or replace view myview as
   select suivi_dossier as suivi_dossier, commune as commune, geom
from table1 UNION ALL
   select suividossier, comm, geom from table2 UNION ALL
   select ... from table3;


Each select must define the same number and type of columns, first
select gives column names for the view.

(OpenJump is a GIS software that can display such views/tables
containing heterogeneous geometry types, as QGIS does not like them)


Nicolas


On Wed, 23 Aug 2023 at 11:31, celati Laurent <laurent.celati at gmail.com>
wrote:

> Good morning,
>
> I have 5 postgis tables which have different types of geometries (1 point,
> 1 linear, 3 polygon). And also different field structures. These tables
> share fields that provide the same information (project_monitoring,
> municipality, etc.). Although the name of these fields is not always
> identical according to the tables.
>
> I would like to be able to create a view that can retrieve a few fields
> from these tables: the geom, the values of municipalities, the
> monitoring_scope  Do you know how I can do?
>
> Thanks a lot.
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20230823/53c512c4/attachment.htm>


More information about the postgis-users mailing list