[postgis-tickets] [PostGIS] #3012: Calling ST_AsLatLonText in matviews causes unrestorable pg_dump (was: Calling PostGIS functions in matviews causes unrestorable pg_dump)
PostGIS
trac at osgeo.org
Sun Jan 18 00:51:24 PST 2015
#3012: Calling ST_AsLatLonText in matviews causes unrestorable pg_dump
--------------------------+-------------------------------------------------
Reporter: jeffcasavant | Owner: pramsey
Type: defect | Status: new
Priority: medium | Milestone: PostGIS PostgreSQL
Component: postgis | Version: 2.1.x
Keywords: |
--------------------------+-------------------------------------------------
Changes (by robe):
* milestone: => PostGIS PostgreSQL
Comment:
Yes it is related to #2485. We can't solve the problem generically short
of forcing everyone to install postgis in a specific schema and your
assessment is not quite right. Calling PostGIS functions in matviews is
fine as long as the function you call doesn't call another PostGIS
function.
In your particular case, if you replace your view definition reference
{{{
ST_AsLatLonText(geom)
}}}
with
{{{
ST_AsLatLonText(geom,'')
}}}
then I bet it restores fine.
When views are compiled, they actually do convert everything to schema
qualified. So the issue is that ST_AsLatLonText(geom) does an
unqualified schema call to ST_AsLatLonText(geom,'').
In your case with ST_AsLatLonText the issue is we have two functions:
st_aslatlontext(geometry, text) and ST_AsLatLonText(geometry). So the one
you are using calls the other one which is not schema qualified thus the
error.
We can fix this particular situation by dropping one of the functions and
just have a default arg for the second. I'll patch that in for 2.2. I
can't patch it in 2.1 since I would be removing a function definition.
strk -- Why did we ever define two functions for ST_AsLatLonText? when in
my mind one with a default arg would have been sufficient, or was this
before we switched to default args?
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/3012#comment:3>
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