Could be that someone "uninstalled" them by deleting from pg_extension.Deleting from pg_extension reproduces the error:
test=# create extension postgis_raster;
CREATE EXTENSION
test=# delete from pg_extension where extname = 'postgis_raster';
DELETE 1
test=# drop extension postgis_raster;
ERROR: extension "postgis_raster" does not exist
test=# create extension postgis_raster;
ERROR: PostGIS Raster is already installed in schema 'public'
CONTEXT: PL/pgSQL function inline_code_block line 10 at RAISE
That last error message does not come from checking pg_extension but rather
postgis_raster itself[2].
I tried DROP SCHEMA extensions CASCADE at this point to get rid of the
remaining objects but that fails:
test=# drop schema extensions cascade;
ERROR: cache lookup failed for extension 27232
_______________________________________________
postgis-users mailing list
postgi...@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/postgis-users
Jim,
We did a series of updates from 10.17 through to 13+ with Postgis some time back on AWS. I just pulled up the notes from the dry run
SELECT PostGIS_Extensions_Upgrade();
does apply to "all the pieces and parts". It wasn't uncommon for it to say Raster (Topology, etc) wasn't available, especially when it wasn't installed.
There was one time where running
SELECT PostGIS_Extensions_Upgrade();
followed by
select postgis_full_version();
indicated we had to run the Extensions Upgrade AGAIN.
Based on your research, it does sound like something may have
been deleted "not using" the AWS/Postgis packaged tools. I don't
know the internals of PostGis enough to even guess.
Can you maybe create a new v 12 database with Postgis and Rastor
installed.. and look in the extension there to see what might be
missing in your main DB?
Roxanne
Jim,
I did a search on this phrase:
raster procs from "2.5.2 r17328" need upgrade
I found a post from Regina from 2020 moving from 2.5.2 to 3. It might illumine a bit.
https://lists.osgeo.org/pipermail/postgis-users/2020-May/044225.html
And this one for someone who had 100% control of their PG
hardware from last fall.
And this one from the AWS forums
which references this:
which uses
ALTER EXTENSION postgis UPDATE;
The observation in the last post about waiting overnight and
things "magically being fixed", I saw during our dry run, not the
production run, but definitely during the dry run. Their
observation about rebooting the PG server between upgrades isn't
totally "off" either.
Posting in the AWS Forums might get some help from inside Amazon.
Or, if you have any level of support from AWS that would allow you get someone to "poke/prod" on disk, you might get a fix.
Migrating the data is "of course" a last resort, but at least
possible.
Given my lack of knowledge of the upgrade steps, I've done what I
can. Good luck.
Roxanne
If this is on AWS RDS, create a ticket with AWS as they have to perform what they call an “under the hood fix”. Hopefully AWS had logged the steps they took when they fixed my instance. Unfortunately I can’t give you the ticket number because of “reasons” ☹. I created a snapshot of our instance, created a DB out of that snapshot and allowed AWS to use that as their testing ground for the fix; They fixed it and I was able to continue my upgrade path. Afterwards, I had to use some hair color to cover up those greys for sure.
Allan Chase
Data Engineer
From: postgis-users <postgis-us...@lists.osgeo.org>
On Behalf Of Jim VanPeursem
Sent: Monday, January 23, 2023 6:32 PM
To: PostGIS Users Discussion <postgi...@lists.osgeo.org>
Subject: [External] Re: [postgis-users] Upgrade 12->13 stuck due to postgis / raster issue
************************** ATTENTION - External Email ************************** |
Please verify the sender before taking any actions or clicking any links. Please treat this email with caution, especially if you are requested to click on a link, decrypt/open an attachment, or enable macros. If you determine this email to be malicious, please report it to phishing. |
CONFIDENTIALITY NOTICE: This electronic message contains information from Bluestaq LLC, which may be company sensitive, proprietary, privileged, or otherwise protected from disclosure. The information is intended to be used solely by the recipient(s) named above. If you are not an intended recipient, be aware that any review, disclosure, copying, distribution, or use of this transmission or its contents is prohibited. Please notify the sender immediately if you have received this transmission in error.
Jim,
At a glance what you have their looks fine. You just need to run
SELECT postgis_extensions_upgrade();
One more time, so it repackages raster functions into postgis_raster and upgrades them.
Then if you don’t need raster support, you can run:
DROP EXTENSION postgis_raster;
You can ignore all those notices, just telling you those extensions you don’t have installed.
Strk, remind me why we have these notices, I think it just confuses people more than being helpful.
Thanks,
Regina
From: postgis-users [mailto:postgis-us...@lists.osgeo.org] On Behalf Of Jim VanPeursem
Sent: Monday, January 23, 2023 8:32 PM
To: PostGIS Users Discussion <postgi...@lists.osgeo.org>
Jim,
Sorry I had missed the thread Roxanne had written.
So you already ran twice
SELECT postgis_extensions_upgrade();
SELECT postgis_extensions_upgrade();
And still shows raster is UNPACKAGED.
If you did delete some raster functions in panic, then I think that would prevent it from being upgraded.
You want to first make sure you don’t have raster tables running the below query should return no records.
SELECT *
FROM raster_columns;
Easy fix especially if you don’t need raster support, is to run the uninstall raster script I had attached in that mailing list thread Roxanne pointed to
https://lists.osgeo.org/pipermail/postgis-users/attachments/20200529/e32c5d8c/attachment.obj
That should cleanly get rid of all remnants of raster.
Hope that helps,
Regina
From: postgis-users [mailto:postgis-us...@lists.osgeo.org] On Behalf Of Roxanne Reid-Bennett
Sent: Monday, January 23, 2023 9:29 PM
To: postgi...@lists.osgeo.org
Subject: Re: [postgis-users] Upgrade 12->13 stuck due to postgis / raster issue
Jim,
db=> SELECT postgis_full_version();POSTGIS="3.1.7 aafe1ff" [EXTENSION] PGSQL="120" (procs need upgrade for use with PostgreSQL "130") GEOS="3.9.1-CAPI-1.14.2" PROJ="8.0.1" LIBXML="2.9.1" LIBJSON="0.13.1" LIBPROTOBUF="1.3.2" WAGYU="0.5.0 (Internal)"
(1 row)
db=> SELECT postgis_extensions_upgrade();
NOTICE: Updating extension postgis 3.1.7
NOTICE: Extension postgis_raster is not available or not packagable for some reason
NOTICE: Extension postgis_topology is not available or not packagable for some reason
NOTICE: Extension postgis_tiger_geocoder is not available or not packagable for some reason
postgis_extensions_upgrade
-------------------------------------------------------------------
Upgrade completed, run SELECT postgis_full_version(); for details
(1 row)
db=> SELECT postgis_full_version();POSTGIS="3.1.7 aafe1ff" [EXTENSION] PGSQL="130" GEOS="3.9.1-CAPI-1.14.2" PROJ="8.0.1" LIBXML="2.9.1" LIBJSON="0.13.1" LIBPROTOBUF="1.3.2" WAGYU="0.5.0 (Internal)"
(1 row)
_______________________________________________
postgis-users mailing list
postgi...@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/postgis-users