[postgis-users] Uniqueness constraint on geometry columns

David Jantzen djantzen at avenace.com
Wed Jun 24 13:13:16 PDT 2015


Hello,

I've encountered a violation of a uniqueness constraint that is surprising,
and I'm hoping for an explanation. Below are repro steps:

create table duplicate_points (the_geom geometry(PointZM, 4326));
create unique index on duplicate_points (the_geom);
insert into duplicate_points (the_geom)
values
('01010000E0E610000019FF3EE3C2955EC068942EFD4BCA474000000000000000000000000000000000'),('01010000E0E610000087E2C8E2C2955EC01BDC94FA4BCA474000000000000000000000000000000000');

If I cast the point column to text then the uniqueness constraint works as
expected:

create unique index on duplicate_points (cast(the_geom as text));

Is there some kind of precision limit being encountered here?

Thanks,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20150624/53820c3f/attachment.html>


More information about the postgis-users mailing list