[postgis-devel] Promote Geometry to MultiGeometry on Insert

Darafei "Komяpa" Praliaskouski me at komzpa.net
Thu Feb 16 20:43:37 PST 2023


I believe that multigeometry constraint is instead a not well-thought
constraint inherited from very legacy systems.

The useful ones are "is it point/multipoint", "is it line/multiline", "is
it area/multiarea". With check for the multi- being with options "no" and
"could be multi, could be single". I don't like us pushing people to
convert all singles to multi: this may mean that in some time we will not
have tables with plain polygons anymore.

I'd say that if we implement such a change we also need to have a nice way
to have "linear" or "areal" dimensionality constraint on the data that will
check that data is poly/multipoly or line/multiline, so it could be
recommended as replacement, with simple results being in the table, not
forcing everything to be more complex.


On Thu, Feb 16, 2023 at 8:20 PM Paul Ramsey <pramsey at cleverelephant.ca>
wrote:

> In 3.1 we started allowing people to insert SRID=0 geometries into columns
> with an SRID typmod, so that people wouldn't have to always add the SRID
> value when what they *meant* was to insert a conforming geometry into the
> column. SRID conflicts would still raise an error, but a SRID=0 is not a
> conflicting SRID, it's an unset SRID, so accepting the geometry and adding
> the typmod column made sense.
>
> In a similar vein, it kind of makes sense to accept simple geometries as
> input to multigeometry columns:
>
> CREATE TABLE mp (geom Geometry(MultiPolygon, 3005);
> INSERT INTO mp VALUES ('POLYGON(...)');
> SELECT ST_AsEWKT(geom) FROM mp;
>
> SRID=3005;MULTIPOLYGON(...)
>
> Again, in the spirit of "do what I mean". If 100% of the time, the
> response to a "geometry type mismatch" is just to wrap the input in
> ST_Multi(), the "data integrity check" isn't really helping, it's just
> adding a step to every interaction.
>
> Comments and concerns?
>
> P
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20230217/e1580344/attachment.htm>


More information about the postgis-devel mailing list