<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Thank you, Regina. I was on 2.4.7. I did the yo-yo</p>
<pre>ALTER EXTENSION postgis UPDATE TO "2.4.7next";
ALTER EXTENSION postgis UPDATE;
</pre>
<p>and the functions now work as expected.<br>
</p>
<div class="moz-signature">
<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>
<div class="moz-cite-prefix">On 7/13/19 12:00 PM, <a class="moz-txt-link-abbreviated" href="mailto:postgis-users-request@lists.osgeo.org">
postgis-users-request@lists.osgeo.org</a> wrote:<br>
</div>
<blockquote type="cite" cite="mid:mailman.27.1563044401.7457.postgis-users@lists.osgeo.org">
<pre class="moz-quote-pre" wrap="">Send postgis-users mailing list submissions to
        <a class="moz-txt-link-abbreviated" href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a>

To subscribe or unsubscribe via the World Wide Web, visit
        <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/postgis-users">https://lists.osgeo.org/mailman/listinfo/postgis-users</a>
or, via email, send a message with subject or body 'help' to
        <a class="moz-txt-link-abbreviated" href="mailto:postgis-users-request@lists.osgeo.org">postgis-users-request@lists.osgeo.org</a>

You can reach the person managing the list at
        <a class="moz-txt-link-abbreviated" href="mailto:postgis-users-owner@lists.osgeo.org">postgis-users-owner@lists.osgeo.org</a>

When replying, please edit your Subject line so it is more specific
than "Re: Contents of postgis-users digest..."


Today's Topics:

   1. ST_Maxdistance schema hardcoding error (Philip M. Hurvitz)
   2. Re: ST_Maxdistance schema hardcoding error (Regina Obe)


----------------------------------------------------------------------

Message: 1
Date: Fri, 12 Jul 2019 18:52:46 +0000
From: "Philip M. Hurvitz" <a class="moz-txt-link-rfc2396E" href="mailto:phurvitz@uw.edu"><phurvitz@uw.edu></a>
To: <a class="moz-txt-link-rfc2396E" href="mailto:postgis-users@lists.osgeo.org">"postgis-users@lists.osgeo.org"</a> <a class="moz-txt-link-rfc2396E" href="mailto:postgis-users@lists.osgeo.org"><postgis-users@lists.osgeo.org></a>,
        <a class="moz-txt-link-rfc2396E" href="mailto:postgis-devel@lists.osgeo.org">"postgis-devel@lists.osgeo.org"</a> <a class="moz-txt-link-rfc2396E" href="mailto:postgis-devel@lists.osgeo.org"><postgis-devel@lists.osgeo.org></a>
Subject: [postgis-users] ST_Maxdistance schema hardcoding error
Message-ID: <a class="moz-txt-link-rfc2396E" href="mailto:41b115ea-ef9e-0129-918f-83f49571ab2b@uw.edu"><41b115ea-ef9e-0129-918f-83f49571ab2b@uw.edu></a>
Content-Type: text/plain; charset="utf-8"

Hi all, I found that ST_MaxDistance() was failing for a database that had the PostGIS extension installed in the schema 'postgis'.

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


It seems that the function is expecting to find the ST_ConvexHull function in the public schema.

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:

SELECT ST_MaxDistance('POINT(0 0)'::geometry, 'LINESTRING ( 2 0, 0 2 )'::geometry);
 st_maxdistance
----------------
              2


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

select postgis_version();
            postgis_version
---------------------------------------
 2.4 USE_GEOS=1 USE_PROJ=1 USE_STATS=1


but postgis_full_version fails

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


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?

Thanks for any info!
--
________________________________
Philip M. Hurvitz
Research Assistant Professor, Urban Design and Planning
Research Scientist, Civil Engineering (TRAC)
<a class="moz-txt-link-freetext" href="http://gis.washington.edu/phurvitz/contact">http://gis.washington.edu/phurvitz/contact</a>
________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <a class="moz-txt-link-rfc2396E" href="http://lists.osgeo.org/pipermail/postgis-users/attachments/20190712/6b6f0e12/attachment-0001.html"><http://lists.osgeo.org/pipermail/postgis-users/attachments/20190712/6b6f0e12/attachment-0001.html></a>

------------------------------

Message: 2
Date: Fri, 12 Jul 2019 19:05:35 -0400
From: "Regina Obe" <a class="moz-txt-link-rfc2396E" href="mailto:lr@pcorp.us"><lr@pcorp.us></a>
To: "'PostGIS Users Discussion'" <a class="moz-txt-link-rfc2396E" href="mailto:postgis-users@lists.osgeo.org"><postgis-users@lists.osgeo.org></a>,
        <a class="moz-txt-link-rfc2396E" href="mailto:postgis-devel@lists.osgeo.org"><postgis-devel@lists.osgeo.org></a>
Subject: Re: [postgis-users] ST_Maxdistance schema hardcoding error
Message-ID: <a class="moz-txt-link-rfc2396E" href="mailto:000801d53906$5526a280$ff73e780$@pcorp.us"><000801d53906$5526a280$ff73e780$@pcorp.us></a>
Content-Type: text/plain; charset="utf-8"

How did you move the extension?

 

And which version are you running.  Since 2.3, PostGIS functions are schema qualified.

 

The easiest way is to force a reinstall.

ALTER EXTENSION  postgis UPDATE;

 

Should work if you are not running the latest version (one listed in your postgis.control).

 

If it gives you an error something like

 

NOTICE: version "2.5.2" of extension "postgis" is already installed

 

Then you can do what I call the yo-yo hack

 

ALTER EXTENSION postgis UPDATE TO "2.5.2next";;

 

Followed by 

ALTER EXTENSION postgis UPDATE TO "2.5.2";

 

From: postgis-users [<a class="moz-txt-link-freetext" href="mailto:postgis-users-bounces@lists.osgeo.org">mailto:postgis-users-bounces@lists.osgeo.org</a>] On Behalf Of Philip M. Hurvitz
Sent: Friday, July 12, 2019 2:53 PM
To: <a class="moz-txt-link-abbreviated" href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a>; <a class="moz-txt-link-abbreviated" href="mailto:postgis-devel@lists.osgeo.org">postgis-devel@lists.osgeo.org</a>
Subject: [postgis-users] ST_Maxdistance schema hardcoding error

 

Hi all, I found that ST_MaxDistance() was failing for a database that had the PostGIS extension installed in the schema 'postgis'.

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

It seems that the function is expecting to find the ST_ConvexHull function in the public schema.

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:

SELECT ST_MaxDistance('POINT(0 0)'::geometry, 'LINESTRING ( 2 0, 0 2 )'::geometry);
 st_maxdistance 
----------------
              2

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

select postgis_version();
            postgis_version            
---------------------------------------
 2.4 USE_GEOS=1 USE_PROJ=1 USE_STATS=1

but postgis_full_version fails

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

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?

 

Thanks for any info!

</pre>
</blockquote>
</body>
</html>