[postgis-tickets] [SCM] postgis.net branch website updated. 77cae92a57d2de888eca1993d2c4842258f8d93d

git at osgeo.org git at osgeo.org
Thu Aug 25 14:57:07 PDT 2022


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  77cae92a57d2de888eca1993d2c4842258f8d93d (commit)
      from  a2857a9de1f5894600656c0af7c2bad34dbe5bf1 (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 77cae92a57d2de888eca1993d2c4842258f8d93d
Author: Regina Obe <lr at pcorp.us>
Date:   Thu Aug 25 17:56:55 2022 -0400

    Tip about how to upgrade postgis-sfcgal from < PostGIS 3.1

diff --git a/content/post/2017/06-05_postgis-backend-is-already-set.md b/content/post/2017/06-05_postgis-backend-is-already-set.md
index a05c694..e6001a3 100644
--- a/content/post/2017/06-05_postgis-backend-is-already-set.md
+++ b/content/post/2017/06-05_postgis-backend-is-already-set.md
@@ -89,22 +89,23 @@ ORDER BY probin;
 ```
 
 In a good, install, you should have only one row that looks something like
-this.  Your version number might be different.
-
-
-	|   probin            | count |
-	|---------------------|-------|
-	|$libdir/postgis-2.4  |   446 |
+this.  Your version number might be different and count might be different.
 
+```
+|   probin            | count |
+|---------------------|-------|
+|$libdir/postgis-2.4  |   446 |
 
+```
 
 If you have more than one row, such as:
 
-| probin               | count
+```
+| probin             | count
 ---------------------+-------
- $libdir/postgis-2.4 |   446
-  $libdir/postgis-2.1 |   4
-(1 row)
+$libdir/postgis-2.4  |   446
+$libdir/postgis-2.1  |   4
+```
 
 
 
diff --git a/content/post/2022/08-25_tip-upgrading-postgis-sfcgal.md b/content/post/2022/08-25_tip-upgrading-postgis-sfcgal.md
new file mode 100644
index 0000000..25b2273
--- /dev/null
+++ b/content/post/2022/08-25_tip-upgrading-postgis-sfcgal.md
@@ -0,0 +1,73 @@
+---
+title: Upgrading postgis_sfcgal to 3.1 or higher
+slug: tip-upgrading-postgis-sfcgal
+layout: post
+category: tips
+tags: [newbie, upgrade]
+author: Regina Obe
+thumbnail:
+date: "2022-08-25"
+---
+
+As of PostGIS 3.1, the PostGIS sfcgal support library is no longer part of the
+`postgis` core library, but instead spun off into a new library `postgis_sfcgal-3`.
+
+This change is not an issue for people doing regular, soft-upgrades from a PostGIS < 3.1 compiled with SFCGAL
+to a PostGIS >= 3.1 with SFCGAL
+using `ALTER EXTENSION postgis_sfcgal UPDATE;` or `SELECT postgis_extensions_upgrade();`.
+However if you are using `pg_upgrade`, you might get errors like `postgis-3` does not contain function `postgis_sfcgal_version()` (which is part of the `postgis_sfcgal` extension).
+
+
+The three main reasons for this break were:
+
+* We wanted `postgis-3` library to have the same exposed functions regardless if you are compiling with SFCGAL or not.
+  This change was planned in PostGIS 3.0, but only the backend switching plumbing was removed and not the complete detachment.
+
+* It makes it possible for packagers to offer `postgis_sfcgal` (perhaps as a separate package),
+  without requiring other users who just want `postgis` to have to have `boost` and `CGAL`.
+
+* In the past `postgis_sfcgal` and `postgis` extensions were hooked together at the hip in the same underlying library, because their were a few functions overlapping
+  in name such as `ST_3DIntersects` and `ST_Intersects`.  Trying to explain to people how this whole thing worked, to switch the backend to sfcgal if they wanted extended 3D functionality, not to mention the added annoyance  [GUC backend of notices during upgrade](/2017/06/05/causes-for-postgis.backend-is-already-set) was more of a pain than it was worth.
+  So moving forward, we will not be reusing function names between the two extensions, and will have only non-overlapping function names.
+
+<!--more-->
+
+## Option 1
+The easiest fix when using `pg_upgrade` to upgrade PostGIS < 3.1 `postgis_sfcgal` is to first drop the `postgis_sfcgal` extension before running `pg_upgrade`.
+
+This can be done without data loss because the `postgis_sfcgal` extension only contains functions and no datatypes.
+After you have dropped it in your old cluster with:
+
+In old cluster before attempting `pg_upgrade`
+```postgres
+-- this step only needed for PostGIS < 3.1.0
+DROP EXTENSION postgis_sfcgal;
+```
+The above `DROP EXTENSION` will fail if you have views. SQL functions, or constraints bound to `postgis_sfcgal` functions.
+In those cases, you can either drop those dependencies too prior to `pg_upgrade` and make sure you have the code to recreate.
+Alternatively you can instead do *[Option 2](#option-2)*.
+
+After you have dropped the extension in your old cluster, you can then run `pg_upgrade`.
+
+After `pg_upgrade`, then in the new cluster, readd it back.
+
+
+```postgres
+CREATE EXTENSION postgis_sfcgal;
+```
+
+The create extension should error out if you don't install in the same schema as `postgis` extension.
+If you get an error, then specify the schema you installed postgis in expplicitly:
+
+ ```postgres
+CREATE EXTENSION postgis_sfcgal SCHEMA postgis;
+```
+
+## Option 2
+On old cluster, make sure you have installed postgis binaries for 3.1 or higher, then do:
+```postgres
+ALTER EXTENSION postgis UPDATE;
+SELECT postgis_extensions_upgrade();
+```
+
+Then run `pg_upgrade` as usual.
\ No newline at end of file

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

Summary of changes:
 .../2017/06-05_postgis-backend-is-already-set.md   | 21 ++++---
 .../2022/08-25_tip-upgrading-postgis-sfcgal.md     | 73 ++++++++++++++++++++++
 2 files changed, 84 insertions(+), 10 deletions(-)
 create mode 100644 content/post/2022/08-25_tip-upgrading-postgis-sfcgal.md


hooks/post-receive
-- 
postgis.net


More information about the postgis-tickets mailing list