[postgis-tickets] [PostGIS] #3975: ST_Transform references spatial_ref_sys without schema
PostGIS
trac at osgeo.org
Thu Jan 11 06:50:09 PST 2018
#3975: ST_Transform references spatial_ref_sys without schema
-------------------------+---------------------------
Reporter: javitonino | Owner: pramsey
Type: defect | Status: new
Priority: medium | Milestone: PostGIS 2.4.3
Component: postgis | Version: 2.4.x
Resolution: | Keywords:
-------------------------+---------------------------
Comment (by pramsey):
OK, I can see two fixes right now, both equally ugly in their own way.
Fix #1:
* Change `st_transform` and `postgis_transform_geometry` into SQL wrappers
move the actual C bindings into `_st_transform` and
`_postgis_transform_geometry`.
* In the wrappers, call the C bindings but include @extschema@ as an
argument, so that we inject the schema into the C call.
* Potentially cleaner but still ugly variant: change the signature of
`st_transform` and `postgis_transform_geometry` to have an extra 'schema'
parameter that has a default value of @extschema@, then we can avoid the
extra level of indirection and get the install schema injected still.
Depends on defaults working and involves changing signature of existing
heavily used function.
Fix #2:
* Go into the C guts of `st_transform` and `postgis_transform_geometry`.
* The FunctionCallInfo includes the Oid of the function being called.
* In the PgSQL syscache, look up the namespace that is associated with
that function Oid.
Both fix #1 and #2 will require changing a lot of proj lookup code to take
not just the SRID number being looked up, but also the schema to look for
spatial_ref_sys in.
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3975#comment:2>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-tickets
mailing list