[postgis-tickets] [SCM] postgis.net branch website updated. 3e516bc3e1620bcc7f1b12419a18fb6909ecac54

git at osgeo.org git at osgeo.org
Fri Feb 3 21:18:20 PST 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "postgis.net".

The branch, website has been updated
       via  3e516bc3e1620bcc7f1b12419a18fb6909ecac54 (commit)
      from  a50e70ef860218b3fd8014a492fc9c343d3af92d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3e516bc3e1620bcc7f1b12419a18fb6909ecac54
Author: Regina Obe <lr at pcorp.us>
Date:   Sat Feb 4 00:12:16 2023 -0500

    Detail how to fix a broken raster install

diff --git a/content/post/2023/02-03_tip-removing-raster-3.md b/content/post/2023/02-03_tip-removing-raster-3.md
new file mode 100644
index 0000000..8911d97
--- /dev/null
+++ b/content/post/2023/02-03_tip-removing-raster-3.md
@@ -0,0 +1,72 @@
+---
+title: Fixing a broken postgis raster install
+slug: tip-removing-raster-from-2-3
+layout: post
+category: tips
+tags: [newbie, upgrade]
+author: Regina Obe
+thumbnail:
+date: "2023-02-03"
+---
+
+As of PostGIS 3.0, the PostGIS raster support is no longer part of the
+`postgis` extension, but instead spun off into a PostGIS extension called `postgis_raster`.
+
+[Upgrading raster from 2.* to 3.*](/2022/01/14/tip-upgrading-raster-from-2-3) covers the proper
+way of upgrading your install from PostGIS 2+ to PostGIS 3+.
+
+Unfortunately many people in a heat of panic when seeing the notice "UNPACKAGED"
+in their check of
+
+```SELECT postgis_full_extension()```
+
+tried to do something like drop raster type with cascade. Dropping the raster type *DOES NOT* remove
+all the raster functions, but *DOES* destroy all your raster data if you had any. Do not do that.
+But if you did happen to do that, this solution is for you.
+
+The only solution after breaking your raster install is to remove the remaining bits of the postgis raster functionality.
+At that point, you can reinstall using `CREATE EXENSION postgis_raster`, or not bother if you don't need
+raster support.
+
+<!--more-->
+
+How do you know your raster install is broken?
+
+If you run:
+
+```postgres
+ALTER EXTENSION postgis UPDATE;
+
+-- yes run it twice
+SELECT postgis_extensions_upgrade();
+SELECT postgis_extensions_upgrade();
+```
+and then check
+
+```postgres
+SELECT postgis_full_version();
+```
+
+and you still see the message
+```RASTER (raster lib from "2.5.3 r17699" need upgrade) [UNPACKAGED!]```
+
+You've broken your raster functionality so badly, it can't be upgraded.
+
+First before doing anything, confirm you have no raster tables.
+The below query should either error out or return **0**:
+
+```postgres
+SELECT count(1) FROM raster_columns;
+```
+
+To fix this issue, run the script [*uninstall_rtpostgis.sql*](/stuff/uninstall_rtpostgis.sql).
+It should remove even older versions of postgis raster functions, since the function sets of older versions are generally a subset of the 2.5.
+
+Now to confirm it is all gone, run the below again.
+
+```postgres
+SELECT postgis_full_version();
+```
+
+You should now see no mention of *RASTER* or *GDAL*.
+

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

Summary of changes:
 content/post/2023/02-03_tip-removing-raster-3.md | 72 ++++++++++++++++++++++++
 1 file changed, 72 insertions(+)
 create mode 100644 content/post/2023/02-03_tip-removing-raster-3.md


hooks/post-receive
-- 
postgis.net


More information about the postgis-tickets mailing list