[postgis-tickets] [SCM] PostGIS branch master updated. 3.1.0alpha2-74-g962ef92

git at osgeo.org git at osgeo.org
Sun Oct 4 12:48:09 PDT 2020


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".

The branch, master has been updated
       via  962ef92215fdac72b317d7d99201931394174afa (commit)
      from  372095d9ae9090400e81167097ed0d9d836c0a7a (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 962ef92215fdac72b317d7d99201931394174afa
Author: Regina Obe <lr at pcorp.us>
Date:   Sun Oct 4 15:47:44 2020 -0400

    Split postgis-sfcgal lib from postgis lib, closes #4258
    
    closes https://git.osgeo.org/gitea/postgis/postgis/pulls/48

diff --git a/.gitignore b/.gitignore
index c4388f9..5405e32 100644
--- a/.gitignore
+++ b/.gitignore
@@ -152,6 +152,9 @@ regress/sfcgal/Makefile
 regress/postgis.sql
 regress/postgis_garden_result.txt
 regress/raster_garden_result.txt
+sfcgal/Makefile
+sfcgal/*.sql
+sfcgal/sfcgal_upgrade.sql.in
 *.so
 st_*.png
 .svn
diff --git a/GNUmakefile.in b/GNUmakefile.in
index 7b10f3b..7562648 100644
--- a/GNUmakefile.in
+++ b/GNUmakefile.in
@@ -6,7 +6,7 @@
 
 SUBDIRS = liblwgeom
 ifeq (@LIBLWGEOM_ONLY@,no)
-SUBDIRS += libpgcommon postgis regress @RASTER@ @TOPOLOGY@ loader utils doc @EXTENSIONS@ @DEPS_SUBDIR@
+SUBDIRS += libpgcommon postgis regress @RASTER@ @TOPOLOGY@ @SFCGAL@ loader utils doc @EXTENSIONS@ @DEPS_SUBDIR@
 endif
 
 POSTGIS_MAJOR_VERSION=@POSTGIS_MAJOR_VERSION@
diff --git a/NEWS b/NEWS
index 9a352a3..681f1b0 100644
--- a/NEWS
+++ b/NEWS
@@ -1,9 +1,10 @@
-PostGIS 3.1.0beta1
+PostGIS 3.1.0alpha3
 2020/xx/xx
 Only tickets not included in 3.1.0alpha2
 
 * Breaking changes *
   - #4737, Bump minimum protobuf-c requirement to 1.1.0 (Raúl Marín)
+  - #4258, Untangle postgis_sfcgal into its own .so (Regina Obe)
 
 * New features *
   - #4698, Add a precision parameter to ST_AsEWKT (Raúl Marín)
diff --git a/configure.ac b/configure.ac
index 0abd06b..91ccd9c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1586,6 +1586,7 @@ AC_OUTPUT([GNUmakefile
    libpgcommon/cunit/Makefile
    postgis/Makefile
    postgis/sqldefines.h
+	 sfcgal/Makefile
    loader/Makefile
    loader/cunit/Makefile
    topology/Makefile
diff --git a/extensions/postgis_sfcgal/Makefile.in b/extensions/postgis_sfcgal/Makefile.in
index cd71bc9..dd7ca48 100644
--- a/extensions/postgis_sfcgal/Makefile.in
+++ b/extensions/postgis_sfcgal/Makefile.in
@@ -62,7 +62,7 @@ sql/$(EXTENSION)--$(EXTVERSION).sql: $(EXTENSION_SCRIPTS) | sql
 	printf '\\echo Use "CREATE EXTENSION $(EXTENSION)" to load this file. \\quit\n' > $@
 	cat $^ > $@
 
-sql_bits/sfcgal.sql: ../../postgis/sfcgal.sql
+sql_bits/sfcgal.sql: ../../sfcgal/sfcgal.sql
 	mkdir -p sql_bits
 	$(PERL) -pe 's/BEGIN\;//g ; s/COMMIT\;//g' $< > $@
 
@@ -83,7 +83,7 @@ sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql: $(EXTENSION_UNPACKAGED_UPGRADE_
 		| $(PERL) ../../utils/create_unpackaged.pl ${EXTENSION} \
 		>> $@
 
-sql_bits/sfcgal_upgrade.sql : ../../postgis/sfcgal_upgrade.sql
+sql_bits/sfcgal_upgrade.sql : ../../sfcgal/sfcgal_upgrade.sql
 	mkdir -p sql_bits
 	$(PERL) -pe 's/BEGIN\;//g ; s/COMMIT\;//g' $< > $@
 
diff --git a/postgis/Makefile.in b/postgis/Makefile.in
index b29047a..b78e0ad 100644
--- a/postgis/Makefile.in
+++ b/postgis/Makefile.in
@@ -18,6 +18,7 @@
 # *
 # **********************************************************************
 # *
+# * Copyright 2020 Regina Obe
 # * Copyright 2008 Mark Cave-Ayland
 # *
 # **********************************************************************
@@ -41,17 +42,10 @@ DATA=../spatial_ref_sys.sql
 SQL_objs=postgis.sql legacy.sql legacy_minimal.sql
 
 GEOM_BACKEND_OBJ = lwgeom_geos.o
-SFCGAL_BACKEND_OBJ = lwgeom_sfcgal.o
 
-ifeq (@SFCGAL@,sfcgal)
-DATA_built=$(SQL_built) sfcgal.sql sfcgal_upgrade.sql uninstall_sfcgal.sql
-SQL_OBJS=$(SQL_objs) sfcgal.sql
-BACKEND_OBJ=$(GEOM_BACKEND_OBJ) $(SFCGAL_BACKEND_OBJ)
-else
 BACKEND_OBJ=$(GEOM_BACKEND_OBJ)
 DATA_built=$(SQL_built)
 SQL_OBJS=$(SQL_objs)
-endif
 
 ifeq (@HAVE_SPGIST@,yes)
 SPGIST_OBJ= gserialized_spgist_2d.o gserialized_spgist_3d.o gserialized_spgist_nd.o
@@ -146,12 +140,6 @@ OBJS=$(PG_OBJS)
 PG_CPPFLAGS += -I../liblwgeom @CFLAGS@ -I../libpgcommon $(WAYGU_INCLUDE) $(UTHASH_INCLUDE) @CPPFLAGS@ @PICFLAGS@
 SHLIB_LINK_F = $(WAYGU_LIB) ../libpgcommon/libpgcommon.a ../liblwgeom/.libs/liblwgeom.a @SHLIB_LINK@
 
-# Add SFCGAL Flags if defined
-ifeq (@SFCGAL@,sfcgal)
-PG_CPPFLAGS += @SFCGAL_CPPFLAGS@
-SHLIB_LINK_F += @SFCGAL_LDFLAGS@
-endif
-
 # Extra files to remove during 'make clean'
 EXTRA_CLEAN=$(SQL_OBJS) \
 	uninstall_postgis.sql \
@@ -159,8 +147,6 @@ EXTRA_CLEAN=$(SQL_OBJS) \
 	uninstall_sfcgal.sql \
 	postgis_upgrade.sql.in \
 	postgis_upgrade.sql \
-	sfcgal_upgrade.sql.in \
-	sfcgal_upgrade.sql \
 	vector_tile.pb-c.c \
 	vector_tile.pb-c.h \
 	geobuf.pb-c.c \
@@ -254,12 +240,6 @@ postgis_upgrade.sql: postgis_before_upgrade.sql postgis_upgrade.sql.in postgis_a
 	cat $^ >> $@
 	echo "COMMIT;" >> $@
 
-sfcgal_upgrade.sql.in: sfcgal.sql ../utils/postgis_proc_upgrade.pl
-	$(PERL) ../utils/postgis_proc_upgrade.pl $< UNUSED > $@
-
-sfcgal_upgrade.sql: sfcgal_upgrade.sql.in postgis_after_upgrade.sql
-	cat $^ > $@
-
 # SQL objects are also dependent on postgis_config.h for PostgreSQL version
 $(SQL_OBJS): ../postgis_config.h ../postgis_revision.h
 
@@ -271,9 +251,6 @@ uninstall_postgis.sql: postgis.sql ../utils/create_undef.pl
 uninstall_legacy.sql: legacy.sql ../utils/create_undef.pl
 	$(PERL) ../utils/create_undef.pl $< $(POSTGIS_PGSQL_VERSION) > $@
 
-uninstall_sfcgal.sql: sfcgal.sql ../utils/create_undef.pl
-	$(PERL) ../utils/create_undef.pl $< $(POSTGIS_PGSQL_VERSION) > $@
-
 distclean: clean
 	rm -f Makefile
 
diff --git a/postgis/postgis_legacy.c b/postgis/postgis_legacy.c
index cb3b001..de663e6 100644
--- a/postgis/postgis_legacy.c
+++ b/postgis/postgis_legacy.c
@@ -18,7 +18,7 @@
  *
  **********************************************************************
  *
- * Copyright (C) 2018 Regina Obe <lr at pcorp.us>
+ * Copyright (C) 2018-2020 Regina Obe <lr at pcorp.us>
  *
  **********************************************************************/
 /******************************************************************************
@@ -77,3 +77,25 @@ POSTGIS_DEPRECATE("3.0.0", intersects);
 POSTGIS_DEPRECATE("3.0.0", pgis_geometry_accum_finalfn);
 POSTGIS_DEPRECATE("3.0.0", postgis_autocache_bbox);
 POSTGIS_DEPRECATE("2.0.0", postgis_uses_stats);
+
+/**Start: SFCGAL functions moved to postgis_sfcgal lib, to ease pg_upgrade **/
+/**: TODO these can be taken out in a later release once PostGIS 3.0 is EOLd **/
+POSTGIS_DEPRECATE("3.1.0", sfcgal_from_ewkt);
+POSTGIS_DEPRECATE("3.1.0", sfcgal_area3D);
+POSTGIS_DEPRECATE("3.1.0", sfcgal_intersection3D);
+POSTGIS_DEPRECATE("3.1.0", sfcgal_difference3D);
+POSTGIS_DEPRECATE("3.1.0", sfcgal_union3D);
+POSTGIS_DEPRECATE("3.1.0", sfcgal_volume);
+POSTGIS_DEPRECATE("3.1.0", sfcgal_extrude);
+POSTGIS_DEPRECATE("3.1.0", sfcgal_straight_skeleton);
+POSTGIS_DEPRECATE("3.1.0", sfcgal_approximate_medial_axis);
+POSTGIS_DEPRECATE("3.1.0", sfcgal_is_planar);
+POSTGIS_DEPRECATE("3.1.0", sfcgal_orientation);
+POSTGIS_DEPRECATE("3.1.0", sfcgal_force_lhr);
+POSTGIS_DEPRECATE("3.1.0", ST_ConstrainedDelaunayTriangles);
+POSTGIS_DEPRECATE("3.1.0", sfcgal_tesselate);
+POSTGIS_DEPRECATE("3.1.0", sfcgal_minkowski_sum);
+POSTGIS_DEPRECATE("3.1.0", sfcgal_make_solid);
+POSTGIS_DEPRECATE("3.1.0", sfcgal_is_solid);
+POSTGIS_DEPRECATE("3.1.0", postgis_sfcgal_noop);
+/**End: SFCGAL functions moved to postgis_sfcgal lib, to ease pg_upgrade **/
diff --git a/regress/Makefile.in b/regress/Makefile.in
index d02beb7..7fe9bae 100644
--- a/regress/Makefile.in
+++ b/regress/Makefile.in
@@ -60,6 +60,11 @@ distclean: clean
 	$(MAKE) -C sfcgal $@
 	rm -f Makefile
 
+staged-install-sfcgal:
+	@if test x"@SFCGAL@" != "x"; then \
+		$(MAKE) -C ../sfcgal REGRESS=1 DESTDIR=$(REGRESS_INSTALLDIR) install; \
+	fi
+
 staged-install-topology:
 	@if test x"@TOPOLOGY@" != "x"; then \
 		$(MAKE) -C ../topology REGRESS=1 DESTDIR=$(REGRESS_INSTALLDIR) install; \
@@ -70,7 +75,7 @@ staged-install-raster:
 		$(MAKE) -C ../raster/rt_pg REGRESS=1 DESTDIR=$(REGRESS_INSTALLDIR) install; \
 	fi
 
-staged-install: staged-install-raster staged-install-topology
+staged-install: staged-install-raster staged-install-topology staged-install-sfcgal
 	$(MAKE) -C ../postgis REGRESS=1 DESTDIR=$(REGRESS_INSTALLDIR) install
 	$(MAKE) -C ../ REGRESS=1 DESTDIR=$(REGRESS_INSTALLDIR) comments-install
 	$(PERL) -pi -e 's,\$$libdir,$(REGRESS_INSTALLDIR)/lib,g' $(REGRESS_INSTALLDIR)/share/contrib/postgis/*.sql
diff --git a/sfcgal/Makefile.in b/sfcgal/Makefile.in
new file mode 100644
index 0000000..517209c
--- /dev/null
+++ b/sfcgal/Makefile.in
@@ -0,0 +1,169 @@
+# **********************************************************************
+# *
+# * PostGIS - Spatial Types for PostgreSQL
+# * http://postgis.net
+# *
+# * PostGIS is free software: you can redistribute it and/or modify
+# * it under the terms of the GNU General Public License as published by
+# * the Free Software Foundation, either version 2 of the License, or
+# * (at your option) any later version.
+# *
+# * PostGIS is distributed in the hope that it will be useful,
+# * but WITHOUT ANY WARRANTY; without even the implied warranty of
+# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# * GNU General Public License for more details.
+# *
+# * You should have received a copy of the GNU General Public License
+# * along with PostGIS.  If not, see <http://www.gnu.org/licenses/>.
+# *
+# **********************************************************************
+# *
+# * Copyright 2020 Regina Obe
+# * Copyright 2008 Mark Cave-Ayland
+# *
+# **********************************************************************
+MODULE_NAME=postgis_sfcgal
+MODULE_big=$(MODULE_NAME)- at POSTGIS_MAJOR_VERSION@
+MODULEDIR=contrib/postgis- at POSTGIS_MAJOR_VERSION@. at POSTGIS_MINOR_VERSION@
+MODULEPATH=$$libdir/$(MODULE_NAME)- at POSTGIS_MAJOR_VERSION@
+POSTGIS_PGSQL_VERSION=@POSTGIS_PGSQL_VERSION@
+
+ifeq (@LIBINCLUDEMINORVERSION@,yes)
+MODULEPATH=$$libdir/$(MODULE_NAME)- at POSTGIS_MAJOR_VERSION@. at POSTGIS_MINOR_VERSION@
+MODULE_big=$(MODULE_NAME)- at POSTGIS_MAJOR_VERSION@. at POSTGIS_MINOR_VERSION@
+endif
+
+# Files to be copied to the contrib/ directory
+DATA_built=sfcgal.sql uninstall_sfcgal.sql sfcgal_upgrade.sql
+DATA=
+
+# SQL preprocessor
+SQLPP = @SQLPP@
+
+# SQL objects (files requiring pre-processing)
+SQL_OBJS = \
+  sfcgal.sql \
+	sfcgal_upgrade.sql.in \
+  sfcgal_upgrade.sql \
+  sfcgal_after_upgrade.sql \
+  sfcgal_before_upgrade.sql
+
+# Objects to build using PGXS
+
+OBJS = lwgeom_sfcgal.o
+
+# Libraries to link into the module (proj, geos)
+#
+# Note: we specify liblwgeom.a directly in SHLIB_LINK rather than using
+# -L... -l options to prevent issues with some platforms trying to link
+# to an existing liblwgeom.so in the PostgreSQL $libdir supplied by an
+# older version of PostGIS, rather than with the static liblwgeom.a
+# supplied with newer versions of PostGIS
+PG_CPPFLAGS += -I../liblwgeom -I../libpgcommon @CFLAGS@ @CPPFLAGS@ @PICFLAGS@
+SHLIB_LINK_F = ../libpgcommon/libpgcommon.a ../liblwgeom/.libs/liblwgeom.a @SHLIB_LINK@
+
+# Add SFCGAL Flags if defined
+ifeq (@SFCGAL@,sfcgal)
+PG_CPPFLAGS += @SFCGAL_CPPFLAGS@
+SHLIB_LINK_F += @SFCGAL_LDFLAGS@
+endif
+
+# Set PERL _after_ the include of PGXS
+PERL=@PERL@
+
+# This is to workaround a bug in PGXS 8.4 win32 link line,
+# see http://trac.osgeo.org/postgis/ticket/1158#comment:57
+SHLIB_LINK := $(SHLIB_LINK_F) $(SHLIB_LINK)
+
+# PGXS information
+PG_CONFIG := @PG_CONFIG@
+PGXS := @PGXS@
+
+$(OBJS): ../liblwgeom/.libs/liblwgeom.a ../libpgcommon/libpgcommon.a ../postgis_config.h
+
+# Note: we specify liblwgeom.a directly in SHLIB_LINK rather than using
+# -L... -l options to prevent issues with some platforms trying to link
+# to an existing liblwgeom.so in the PostgreSQL $libdir supplied by an
+# older version of PostGIS, rather than with the static liblwgeom.a
+# supplied with newer versions of PostGIS
+PG_CPPFLAGS += -I../liblwgeom -I../libpgcommon @CFLAGS@ @CPPFLAGS@ @PICFLAGS@
+SHLIB_LINK_F = ../libpgcommon/libpgcommon.a ../liblwgeom/.libs/liblwgeom.a @SHLIB_LINK@
+
+# Add SFCGAL Flags if defined
+ifeq (@SFCGAL@,sfcgal)
+PG_CPPFLAGS += @SFCGAL_CPPFLAGS@
+SHLIB_LINK_F += @SFCGAL_LDFLAGS@
+endif
+
+# Extra files to remove during 'make clean'
+EXTRA_CLEAN=$(SQL_OBJS) \
+	uninstall_sfcgal.sql
+
+# PGXS information
+PG_CONFIG := @PG_CONFIG@
+PGXS := @PGXS@
+# NO_TEMP_INSTALL is a workaround for a 9.5dev bug. See:
+# http://www.postgresql.org/message-id/CAB7nPqTsR5o3g-fBi6jbsVdhfPiLFWQ_0cGU5=94Rv_8W3qvFA@mail.gmail.com
+NO_TEMP_INSTALL=yes
+include $(PGXS)
+
+# Set PERL _after_ the include of PGXS
+PERL=@PERL@
+
+# This is to workaround a bug in PGXS 8.4 win32 link line,
+# see http://trac.osgeo.org/postgis/ticket/1158#comment:57
+SHLIB_LINK := $(SHLIB_LINK_F) $(SHLIB_LINK)
+
+# NOTE: setting LDFLAGS explicitly here avoids getting the
+# link line polluted by unrelated PostgreSQL switches that
+# may be confusing and out-of-control for the builder of
+# PostGIS
+LDFLAGS = @LDFLAGS@
+
+# If REGRESS=1 passed as a parameter, change the default install paths
+# so that no prefix is included. This allows us to relocate to a temporary
+# directory for regression testing.
+ifeq ($(REGRESS),1)
+	bindir=/bin
+	pkglibdir=/lib
+	datadir=/share
+	datamoduledir=contrib/postgis
+endif
+
+# Make all PostGIS objects depend upon liblwgeom, so that if an underlying
+# change is made, a PostGIS rebuild is triggered.
+#
+# Also they are all dependent on postgis_config.h
+# and thus postgis_revision.h
+#
+$(PG_OBJS): ../liblwgeom/.libs/liblwgeom.a ../libpgcommon/libpgcommon.a ../postgis_config.h ../postgis_revision.h
+
+# Borrow the $libdir substitution from PGXS but customise by running the preprocessor
+# and adding the version number
+# replace @extschema at . with nothing, this is only used as placeholder for extension install
+%.sql: %.sql.in
+	$(SQLPP) -I../libpgcommon $< | grep -v '^#' | \
+	$(PERL) -lpe "s'MODULE_PATHNAME'\$(MODULEPATH)'g;s'@extschema@\.''g" > $@
+
+sfcgal_upgrade.sql.in: sfcgal.sql ../utils/postgis_proc_upgrade.pl
+	$(PERL) ../utils/postgis_proc_upgrade.pl $< UNUSED > $@
+
+sfcgal_upgrade.sql: sfcgal_before_upgrade.sql sfcgal_upgrade.sql.in sfcgal_after_upgrade.sql
+	echo "BEGIN;" > $@
+	cat $^ >> $@
+	echo "COMMIT;" >> $@
+
+uninstall_sfcgal_legacy.sql: sfcgal_legacy.sql ../utils/create_undef.pl
+	$(PERL) ../utils/create_undef.pl $< $(POSTGIS_PGSQL_VERSION) > $@
+
+uninstall_sfcgal.sql: sfcgal.sql ../utils/create_undef.pl
+	$(PERL) ../utils/create_undef.pl $< $(POSTGIS_PGSQL_VERSION) > $@
+
+distclean: clean
+	rm -f Makefile
+
+check-unit:
+
+check-regress:
+
+maintainer-clean: distclean
diff --git a/postgis/lwgeom_sfcgal.c b/sfcgal/lwgeom_sfcgal.c
similarity index 91%
rename from postgis/lwgeom_sfcgal.c
rename to sfcgal/lwgeom_sfcgal.c
index 6ab8afa..3e3729b 100644
--- a/postgis/lwgeom_sfcgal.c
+++ b/sfcgal/lwgeom_sfcgal.c
@@ -18,19 +18,85 @@
  *
  **********************************************************************
  *
- * Copyright 2012-2013 Oslandia <infos at oslandia.com>
+ * Copyright 2012-2020 Oslandia <infos at oslandia.com>
  *
  **********************************************************************/
-
 #include "postgres.h"
 #include "fmgr.h"
 #include "utils/builtins.h"
-#include "../liblwgeom/liblwgeom.h"
-
 #include "lwgeom_pg.h"
 #include "lwgeom_sfcgal.h"
 #include "../postgis_config.h"
 
+
+#include "utils/elog.h"
+#include "utils/guc.h"
+#include "libpq/pqsignal.h"
+#include "../liblwgeom/liblwgeom.h"
+
+/*
+ * This is required for builds against pgsql
+ */
+PG_MODULE_MAGIC;
+#ifdef WIN32
+static void interruptCallback() {
+  if (UNBLOCKED_SIGNAL_QUEUE())
+    pgwin32_dispatch_queued_signals();
+}
+#endif
+
+static pqsigfunc coreIntHandler = 0;
+static void handleInterrupt(int sig);
+
+/*
+ * Module load callback
+ */
+void _PG_init(void);
+void
+_PG_init(void)
+{
+
+  coreIntHandler = pqsignal(SIGINT, handleInterrupt);
+
+#ifdef WIN32
+  GEOS_interruptRegisterCallback(interruptCallback);
+  lwgeom_register_interrupt_callback(interruptCallback);
+#endif
+
+    /* install PostgreSQL handlers */
+    pg_install_lwgeom_handlers();
+}
+
+/*
+ * Module unload callback
+ */
+void _PG_fini(void);
+void
+_PG_fini(void)
+{
+  elog(NOTICE, "Goodbye from PostGIS SFCGAL %s", POSTGIS_VERSION);
+  pqsignal(SIGINT, coreIntHandler);
+}
+
+
+static void
+handleInterrupt(int sig)
+{
+  /* NOTE: printf here would be dangerous, see
+   * https://trac.osgeo.org/postgis/ticket/3644
+   *
+   * TODO: block interrupts during execution, to fix the problem
+   */
+  /* printf("Interrupt requested\n"); fflush(stdout); */
+
+  /* request interruption of liblwgeom as well */
+  lwgeom_request_interrupt();
+
+  if ( coreIntHandler ) {
+    (*coreIntHandler)(sig);
+  }
+}
+
 Datum postgis_sfcgal_version(PG_FUNCTION_ARGS);
 
 Datum sfcgal_from_ewkt(PG_FUNCTION_ARGS);
diff --git a/postgis/lwgeom_sfcgal.h b/sfcgal/lwgeom_sfcgal.h
similarity index 100%
rename from postgis/lwgeom_sfcgal.h
rename to sfcgal/lwgeom_sfcgal.h
diff --git a/postgis/sfcgal.sql.in b/sfcgal/sfcgal.sql.in
similarity index 99%
rename from postgis/sfcgal.sql.in
rename to sfcgal/sfcgal.sql.in
index ecc1cc8..5d8a629 100644
--- a/postgis/sfcgal.sql.in
+++ b/sfcgal/sfcgal.sql.in
@@ -12,7 +12,7 @@
 -- New SFCGAL functions (meaning prototype not already provided by GEOS)
 --
 
-#include "sqldefines.h"
+#include "../postgis/sqldefines.h"
 
 -- INSTALL VERSION: POSTGIS_LIB_VERSION
 
diff --git a/sfcgal/sfcgal_after_upgrade.sql.in b/sfcgal/sfcgal_after_upgrade.sql.in
new file mode 100644
index 0000000..3e780e5
--- /dev/null
+++ b/sfcgal/sfcgal_after_upgrade.sql.in
@@ -0,0 +1,18 @@
+-- PostGIS - Spatial Types for PostgreSQL
+-- http://postgis.net
+--
+-- Copyright (C) 2020 Regina Obe <lr at pcorp.us>
+-- This is free software; you can redistribute and/or modify it under
+-- the terms of the GNU General Public Licence. See the COPYING file.
+--
+--
+-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+-- These are reserved for functions that are changed to use default args
+-- This is installed after the new functions are installed
+-- We don't have any of these yet for sfcgal
+-- The reason we put these after install is
+-- you can't drop a function that is used by sql functions
+-- without forcing a drop on those as well which may cause issues with user functions.
+-- This allows us to CREATE OR REPLACE those in general sfcgal.sql.in
+-- without dropping them.
+
diff --git a/sfcgal/sfcgal_before_upgrade.sql.in b/sfcgal/sfcgal_before_upgrade.sql.in
new file mode 100644
index 0000000..5d1e7f6
--- /dev/null
+++ b/sfcgal/sfcgal_before_upgrade.sql.in
@@ -0,0 +1,13 @@
+-- PostGIS - Spatial Types for PostgreSQL
+-- http://postgis.net
+--
+-- Copyright (C) 2020 Regina Obe <lr at pcorp.us>
+-- This is free software; you can redistribute and/or modify it under
+-- the terms of the GNU General Public Licence. See the COPYING file.
+--
+--
+-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+-- These are functions that need to be dropped beforehand
+-- where the argument names may have changed  --
+-- so have to be dropped before upgrade can happen --
+-- argument names changed --

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

Summary of changes:
 .gitignore                                         |   3 +
 GNUmakefile.in                                     |   2 +-
 NEWS                                               |   3 +-
 configure.ac                                       |   1 +
 extensions/postgis_sfcgal/Makefile.in              |   4 +-
 postgis/Makefile.in                                |  25 +--
 postgis/postgis_legacy.c                           |  24 ++-
 regress/Makefile.in                                |   7 +-
 sfcgal/Makefile.in                                 | 169 +++++++++++++++++++++
 {postgis => sfcgal}/lwgeom_sfcgal.c                |  74 ++++++++-
 {postgis => sfcgal}/lwgeom_sfcgal.h                |   0
 {postgis => sfcgal}/sfcgal.sql.in                  |   2 +-
 .../sfcgal_after_upgrade.sql.in                    |   8 +-
 .../sfcgal_before_upgrade.sql.in                   |  17 +--
 14 files changed, 289 insertions(+), 50 deletions(-)
 create mode 100644 sfcgal/Makefile.in
 rename {postgis => sfcgal}/lwgeom_sfcgal.c (91%)
 rename {postgis => sfcgal}/lwgeom_sfcgal.h (100%)
 rename {postgis => sfcgal}/sfcgal.sql.in (99%)
 copy topology/topology_drop_after.sql.in => sfcgal/sfcgal_after_upgrade.sql.in (69%)
 copy extensions/postgis_tiger_geocoder/sql_bits/add_search_path.sql.in => sfcgal/sfcgal_before_upgrade.sql.in (50%)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list