<div dir="ltr">Thanks Regina. It makes sense now. I appreciated the detailed explanation. You are the best. Thanks again, Marcelo :)</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 7, 2022 at 3:21 PM Regina Obe <<a href="mailto:lr@pcorp.us">lr@pcorp.us</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg-6317380836661885511"><div lang="EN-US"><div class="m_-6317380836661885511WordSection1"><p class="MsoNormal">The below <b>ERROR:  type "raster" is only a shell</b> is usually not an error but a NOTICE that tells you the raster type has not been defined yet.  It happens when functions using the raster type are created before the raster type is created.  As long as the raster type is created before the install is complete, then it does not error, and might show as a NOTICE.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">The fact it shows as an error in your case<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Suggests to me, 3 possible scenarios<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">a) You managed to get yourself into a state where you have no raster type, which should be impossible if you are doing an upgrade of raster, unless you did some Frankenstein surgery on your raster, as people often do when they panic and see the “Raster is unpackaged” message and start deleting stuff randomly.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Like with a command<u></u><u></u></p><p class="MsoNormal">DROP TYPE raster CASCADE;<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">If this is the scenario you have, you’ve already destroyed any raster data you had, so best course of action is still<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">-- uninstall postgis_raster<br><br>psql<br>\c rev<br>\i 'C:\\Program Files\\PostgreSQL\\12\\share\\contrib\\postgis-3.2\\<b>uninstall_rtpostgis.sql</b>'<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">b)  You did this when you actually had no postgis_raster installed at all.<u></u><u></u></p><p class="MsoNormal"><b>CREATE EXTENSION postgis_raster SCHEMA public VERSION unpackaged;<u></u><u></u></b></p><p class="MsoNormal"><b><u></u> <u></u></b></p><p class="MsoNormal"><b>And then </b>Trying to do below after a rasterless raster extension I would expect to fail with the above notice – this is what postgis_extensions_upgrade() would be doing internally<u></u><u></u></p><p class="MsoNormal"><b>ALTER EXTENSION postgis_raster UPDATE TO "3.2.3""</b><br><br><b><u></u><u></u></b></p><p class="MsoNormal">This is a fake install, and can be dropped with<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><b>DROP EXTENSION postgis_raster;<u></u><u></u></b></p><p class="MsoNormal"><b><u></u> <u></u></b></p><p class="MsoNormal">but the fact you showed (raster procs from ""2.4.4 r16526"" need upgrade)" suggests this is not the case, and you are more likely facing a) or c) <br><br><b><u></u><u></u></b></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">c) You installed raster in a separate schema from postgis, this again I can’t imagine how this is possible, unless you started<u></u><u></u></p><p class="MsoNormal">with a postgis install from 2.4.4, using scripts instead of the extension system and then you decided to run postgis.sql in one schema and rtpostgis.sql in a separate schema.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">And then you proceeded to then convert to an extensions based install.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">In a regular extension install, both postgis.sql and rtpostgis.sql are packaged together, so having them somehow end up in different schemas would be I think impossible, though I would be impressed if someone could prove me wrong.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Assuming you did an extensionless install, putting raster and postgis in separate schemas<u></u><u></u></p><p class="MsoNormal">The fix (not tested) would be:<u></u><u></u></p><p class="MsoNormal">Figure out which schema you have raster installed in, and make sure you do your unpackaged install in the same schema as follows:<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><b>CREATE EXTENSION postgis_raster SCHEMA <the schema it is installed in here> VERSION unpackaged;<u></u><u></u></b></p><p class="MsoNormal"><b>ALTER EXTENSION postgis_raster UPDATE;<u></u><u></u></b></p><p class="MsoNormal">-- this part you need to do because postgis_raster is no longer relocatable, and we require both postgis and postgis_raster to reside in the same schema.<u></u><u></u></p><p class="MsoNormal">-- allow you to move it<u></u><u></u></p><p class="MsoNormal"><b>UPDATE pg_extension SET extrelocatable = true WHERE extname ='postgis_raster';<u></u><u></u></b></p><p class="MsoNormal">-- move it<u></u><u></u></p><p class="MsoNormal"><b>ALTER EXTENSION postgis_raster SET SCHEMA <where the postgis extension is installed>;<u></u><u></u></b></p><p class="MsoNormal">-- at this point many of your raster functions are broken cause they are pointing at the old schema, this fixes that mess<u></u><u></u></p><p class="MsoNormal"><b>ALTER EXTENSION postgis_raster UPDATE;<u></u><u></u></b></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p><div style="border-top:none;border-right:none;border-bottom:none;border-left:1.5pt solid blue;padding:0in 0in 0in 4pt"><div><div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0in 0in"><p class="MsoNormal"><b><span style="font-size:11pt;font-family:Calibri,sans-serif">From:</span></b><span style="font-size:11pt;font-family:Calibri,sans-serif"> postgis-users [mailto:<a href="mailto:postgis-users-bounces@lists.osgeo.org" target="_blank">postgis-users-bounces@lists.osgeo.org</a>] <b>On Behalf Of </b>Marcelo Marques<br><b>Sent:</b> Wednesday, September 7, 2022 5:07 PM<br><b>To:</b> PostGIS Users Discussion <<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a>><br><b>Subject:</b> [postgis-users] ERROR: type "raster" is only a shell<u></u><u></u></span></p></div></div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal" style="margin-bottom:12pt">-- Platform:<br>Windows Server 2019<br>PostgreSQL 12.12<br>Postgis 3.2.3<br><br><b>SELECT postgis_full_version();</b><br><br>"POSTGIS=""3.2.3 3.2.3"" [EXTENSION] PGSQL=""120"" GEOS=""3.10.3-CAPI-1.16.1"" PROJ=""7.2.1"" <br>LIBXML=""2.9.9"" LIBJSON=""0.12"" LIBPROTOBUF=""1.2.1"" WAGYU=""0.5.0 (Internal)"" <br>(raster procs from ""2.4.4 r16526"" need upgrade)"<br><br>** NOTE: postgis 3.2.3 and raster 2.4.4 **<br><br><b>**-- Upgrade the Postgis Extensions**</b><br><br><b>SELECT postgis_extensions_upgrade();</b><br><br>NOTICE:  Packaging extension postgis_raster<br><br><b>ERROR:  type "raster" is only a shell</b><br><br>CONTEXT:  SQL statement<br><br><b>"CREATE EXTENSION postgis_raster SCHEMA public VERSION unpackaged;<br><br>ALTER EXTENSION postgis_raster UPDATE TO "3.2.3""</b><br><br>PL/pgSQL function postgis_extensions_upgrade() line 71 at EXECUTE<br><br>SQL state: 42704<br><br><b>**QUESTIONS:**</b><br><br>Why the extension upgrade returns "ERROR:  type "raster" is only a shell" ???<br><br>Is this another bug ???<br><br>Is there any other workaround for this issue besides "uninstall_rtpostgis.sql" described below ???<br><br><b>**--SOLUTION: **</b><br><br>-- uninstall postgis_raster<br><br>psql<br>\c rev<br>\i 'C:\\Program Files\\PostgreSQL\\12\\share\\contrib\\postgis-3.2\\<b>uninstall_rtpostgis.sql</b>'<br><br><b>SELECT postgis_extensions_upgrade();</b><br><br>"Upgrade completed, run SELECT postgis_full_version(); for details"<br><br>NOTICE:  Extension postgis_raster is not available or not packagable for some reason<br><br>NOTICE:  Extension postgis_sfcgal is not available or not packagable for some reason<br><br>NOTICE:  Extension postgis_topology is not available or not packagable for some reason<br><br>NOTICE:  Extension postgis_tiger_geocoder is not available or not packagable for some reason<br><br>Successfully run. Total query runtime: 144 msec.<br>1 rows affected.<br><br><br><b>SELECT postgis_full_version();</b><br><br>"POSTGIS=""3.2.3 3.2.3"" [EXTENSION] PGSQL=""120"" GEOS=""3.10.3-CAPI-1.16.1"" PROJ=""7.2.1"" <br>LIBXML=""2.9.9"" LIBJSON=""0.12"" LIBPROTOBUF=""1.2.1"" WAGYU=""0.5.0 (Internal)"""<br><br><b>CREATE EXTENSION postgis_raster;</b><br><br>CREATE EXTENSION<br><br>Query returned successfully in 227 msec.<br><br><b>SELECT postgis_full_version();</b><br><br>"POSTGIS=""3.2.3 3.2.3"" [EXTENSION] PGSQL=""120"" GEOS=""3.10.3-CAPI-1.16.1"" PROJ=""7.2.1"" <br>GDAL=""GDAL 3.4.3, released 2022/04/22 GDAL_DATA not found"" <br>LIBXML=""2.9.9"" LIBJSON=""0.12"" LIBPROTOBUF=""1.2.1"" WAGYU=""0.5.0 (Internal)"" RASTER"<br><br><b>SELECT * FROM pg_available_extensions WHERE name LIKE 'postgis%';</b><br><br>"name" "default_version" "installed_version" "comment"<br><br>"postgis" "3.2.3" "3.2.3" "PostGIS geometry and geography spatial types and functions"<br><br>"postgis_raster" "3.2.3" "3.2.3" "PostGIS raster types and functions"<br><br><b>DROP EXTENSION postgis_raster;</b><br><br>DROP EXTENSION<br><br>Query returned successfully in 94 msec.<br><br>------------------------------------------------------<br><br>I appreciate the assistance to clarify my questions.<br><br>Thanks,<br><br>Marcelo Marques | Principal Product Engineer | Esri - <a href="http://www.esri.com" target="_blank">www.esri.com</a> |<br><br><u></u><u></u></p></div></div></div></div>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-users</a><br>
</div></blockquote></div>