[postgis-tickets] r17072 - Create rt_legacy.c and postgis_legacy.c put back functions taken out in 2.5 and put them in these files. Stub them with errors.
Regina Obe
lr at pcorp.us
Sat Nov 24 08:35:17 PST 2018
Author: robe
Date: 2018-11-24 20:35:17 -0800 (Sat, 24 Nov 2018)
New Revision: 17072
Added:
trunk/postgis/postgis_legacy.c
trunk/raster/rt_pg/rtpg_legacy.c
Modified:
trunk/postgis/Makefile.in
trunk/raster/rt_pg/Makefile.in
Log:
Create rt_legacy.c and postgis_legacy.c put back functions taken out in 2.5 and put them in these files. Stub them with errors.
Still need to check 2.1 - 2.4 for things we might have taken out (only test pg_upgrade from 9.4 2.4 to 11 3.0 which failed with 3.0 needs dump restore)
References #4193 for PostGIS 3.0 (trunk)
Modified: trunk/postgis/Makefile.in
===================================================================
--- trunk/postgis/Makefile.in 2018-11-25 01:33:04 UTC (rev 17071)
+++ trunk/postgis/Makefile.in 2018-11-25 04:35:17 UTC (rev 17072)
@@ -122,7 +122,8 @@
mvt.o \
lwgeom_out_mvt.o \
geobuf.o \
- lwgeom_out_geobuf.o
+ lwgeom_out_geobuf.o \
+ postgis_legacy.o
# Objects to build using PGXS
OBJS=$(PG_OBJS)
Added: trunk/postgis/postgis_legacy.c
===================================================================
--- trunk/postgis/postgis_legacy.c (rev 0)
+++ trunk/postgis/postgis_legacy.c 2018-11-25 04:35:17 UTC (rev 17072)
@@ -0,0 +1,62 @@
+/**********************************************************************
+ *
+ * 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 (C) 2018 Regina Obe <lr at pcorp.us>
+ *
+ **********************************************************************/
+/******************************************************************************
+ * This file is to hold functions we no longer use,
+ * but we need to keep because they were used at one time behind SQL API functions.
+ * This is to ease pg_upgrade upgrades
+ *
+ * All functions in this file should throw an error telling the user to upgrade
+ * the install
+ *
+ *****************************************************************************/
+
+#include "postgres.h"
+#include "utils/builtins.h"
+#include "../postgis_config.h"
+#include "lwgeom_pg.h"
+
+/** pgis_abs_in: Removed PostGIS 2.5.0 **/
+Datum pgis_abs_in(PG_FUNCTION_ARGS);
+PG_FUNCTION_INFO_V1(pgis_abs_in);
+
+Datum
+pgis_abs_in(PG_FUNCTION_ARGS)
+{
+ ereport(ERROR,(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("function %s is out of date. Run: ALTER EXTENSION postgis UPDATE;", __func__)));
+ PG_RETURN_POINTER(NULL);
+}
+
+/** pgis_abs_out: Removed PostGIS 2.5.0 **/
+Datum pgis_abs_out(PG_FUNCTION_ARGS);
+
+PG_FUNCTION_INFO_V1(pgis_abs_out);
+Datum
+pgis_abs_out(PG_FUNCTION_ARGS)
+{
+ ereport(ERROR,(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("function %s is out of date. Run: ALTER EXTENSION postgis UPDATE;", __func__)));
+ PG_RETURN_POINTER(NULL);
+}
+
Modified: trunk/raster/rt_pg/Makefile.in
===================================================================
--- trunk/raster/rt_pg/Makefile.in 2018-11-25 01:33:04 UTC (rev 17071)
+++ trunk/raster/rt_pg/Makefile.in 2018-11-25 04:35:17 UTC (rev 17072)
@@ -45,6 +45,7 @@
OBJS = \
rtpostgis.o \
rtpg_internal.o \
+ rtpg_legacy.o \
rtpg_spatial_relationship.o \
rtpg_mapalgebra.o \
rtpg_utility.o \
Added: trunk/raster/rt_pg/rtpg_legacy.c
===================================================================
--- trunk/raster/rt_pg/rtpg_legacy.c (rev 0)
+++ trunk/raster/rt_pg/rtpg_legacy.c 2018-11-25 04:35:17 UTC (rev 17072)
@@ -0,0 +1,55 @@
+/**********************************************************************
+ *
+ * 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 (C) 2018 Regina Obe <lr at pcorp.us>
+ *
+ **********************************************************************/
+
+/******************************************************************************
+ * This file is to hold functions we no longer use,
+ * but we need to keep because they were used at one time behind SQL API functions.
+ * This is to ease pg_upgrade upgrades
+ *
+ * All functions in this file should throw an error telling the user to upgrade
+ * the install
+ *
+ *****************************************************************************/
+
+#include <postgres.h>
+#include <fmgr.h>
+
+#include "rtpostgis.h"
+
+/** obsolete as of 2.5.0 stubbing for smoother upgrade from 2.4 **/
+Datum RASTER_to_binary(PG_FUNCTION_ARGS);
+
+/**
+ *
+ * Removed in PostGIS 2.5.0
+ */
+PG_FUNCTION_INFO_V1(RASTER_to_binary);
+Datum RASTER_to_binary(PG_FUNCTION_ARGS)
+{
+
+ elog(ERROR, "RASTER_to_binary: This function is out of date. Run: ALTER EXTENSION postgis UPDATE; SELECT PostGIS_Extensions_Upgrade();");
+
+}
+
+
More information about the postgis-tickets
mailing list