<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi all, I found that ST_MaxDistance() was failing for a database that had the PostGIS extension installed in the schema 'postgis'.</p>
<pre>SELECT ST_MaxDistance('POINT(0 0)'::geometry, 'LINESTRING ( 2 0, 0 2 )'::geometry);
ERROR:  function public.st_convexhull(geometry) does not exist
LINE 1: SELECT public._ST_MaxDistance(public.ST_ConvexHull($1), publ...
                                      ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
QUERY:  SELECT public._ST_MaxDistance(public.ST_ConvexHull($1), public.ST_ConvexHull($2))
CONTEXT:  SQL function "st_maxdistance" during startup
Time: 147.448 ms
</pre>
<p>It seems that the function is expecting to find the ST_ConvexHull function in the public schema.<br>
</p>
<p>As a workaround I edited the code for the _ST_MaxDistance and ST_ConvexHull to create identical functions in the public schema and now things work as expected:</p>
<pre>SELECT ST_MaxDistance('POINT(0 0)'::geometry, 'LINESTRING ( 2 0, 0 2 )'::geometry);
 st_maxdistance 
----------------
              2
</pre>
<div class="moz-signature">I had originally installed PostGIS in the public schema but then relocated the extension to the postgis schema -- could this be the reason? Other functions are acting strangely, e.g., postgis_version works OK<br>
</div>
<div class="moz-signature">
<pre>select postgis_version();
            postgis_version            
---------------------------------------
 2.4 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
</pre>
</div>
<div class="moz-signature">but postgis_full_version fails<br>
</div>
<div class="moz-signature">
<pre>select postgis_full_version();
ERROR:  function public.postgis_lib_version() does not exist
LINE 1: SELECT public.postgis_lib_version()
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
QUERY:  SELECT public.postgis_lib_version()
CONTEXT:  PL/pgSQL function postgis_full_version() line 25 at SQL statement
</pre>
</div>
<div class="moz-signature">Does anyone know if there is a fix for rewriting the functions that are looking in public for functions that are located in the postgis schema?</div>
<div class="moz-signature"><br>
</div>
<div class="moz-signature">Thanks for any info!<br>
</div>
<div class="moz-signature">-- <br>
<hr>
Philip M. Hurvitz<br>
Research Assistant Professor, Urban Design and Planning<br>
Research Scientist, Civil Engineering (TRAC)<br>
<a href="http://gis.washington.edu/phurvitz/contact">http://gis.washington.edu/phurvitz/contact</a>
<hr>
</div>
</body>
</html>