Opened 5 years ago

Closed 5 years ago

#4569 closed enhancement (fixed)

Allow SRID coercion when inserting unknown SRID geometry into known SRID column

Reported by: pramsey Owned by: pramsey
Priority: medium Milestone: PostGIS 3.1.0
Component: postgis Version: master
Keywords: Cc:

Description

Currently, inserting a SRID=0 geometry into a column with SRID typmod results in an error, so:

CREATE TABLE foo (g geometry(point, 4326));
INSERT INTO foo ( 'POINT(1 1)' );

does not work. This results in a lot of extra hand waving just to get data into place, and in teaching environments is annoying. The intent of putting unknown things into known places is fairly clear: we mean for them to be in the same reference system.

This change will allow the above, but all other cases will remain the same: mis-matched known SRID will still generate errors.

Change History (1)

comment:1 by Paul Ramsey <pramsey@…>, 5 years ago

Resolution: fixed
Status: newclosed

In f95dfc7/git:

Allow SRID coercion when inserting unknown SRID geometry into known SRID column
Closes #4569

Note: See TracTickets for help on using tickets.