[postgis-tickets] r16569 - Support for PostgreSQL 9.5 use Int64GetDatum instead of UInt64GetDatum for < 9.6

Regina Obe lr at pcorp.us
Wed May 9 03:21:03 PDT 2018


Author: robe
Date: 2018-05-09 03:21:03 -0700 (Wed, 09 May 2018)
New Revision: 16569

Modified:
   trunk/raster/rt_pg/rtpg_band_properties.c
   trunk/raster/test/regress/load_outdb.sql
Log:
Support for PostgreSQL 9.5 use Int64GetDatum instead of UInt64GetDatum for < 9.6
Revise tests to disable outdb first so that error test consitently fails even if default state is to have out db allowed
Closes #4083 for PostGIS 2.5.0
Closes https://github.com/postgis/postgis/pull/240

Modified: trunk/raster/rt_pg/rtpg_band_properties.c
===================================================================
--- trunk/raster/rt_pg/rtpg_band_properties.c	2018-05-09 07:30:42 UTC (rev 16568)
+++ trunk/raster/rt_pg/rtpg_band_properties.c	2018-05-09 10:21:03 UTC (rev 16569)
@@ -736,8 +736,13 @@
 		}
 
 		if (bmd2[call_cntr].filesize) {
+#if POSTGIS_PGSQL_VERSION > 95
                     values[6] = UInt64GetDatum(bmd2[call_cntr].filesize);
                     values[7] = UInt64GetDatum(bmd2[call_cntr].timestamp);
+#else /* POSTGIS_PGSQL_VERSION <= 95 */
+                    values[6] = Int64GetDatum(bmd2[call_cntr].filesize);
+                    values[7] = Int64GetDatum(bmd2[call_cntr].timestamp);
+#endif
                 }
                 else {
                     nulls[6] = TRUE;

Modified: trunk/raster/test/regress/load_outdb.sql
===================================================================
--- trunk/raster/test/regress/load_outdb.sql	2018-05-09 07:30:42 UTC (rev 16568)
+++ trunk/raster/test/regress/load_outdb.sql	2018-05-09 10:21:03 UTC (rev 16569)
@@ -1,3 +1,4 @@
+SET postgis.enable_outdb_rasters = false;
 SELECT count(*) FROM raster_outdb_template;
 SELECT DISTINCT ST_BandFileSize(rast) FROM raster_outdb_template;
 SELECT DISTINCT ST_BandFileTimestamp(rast) FROM raster_outdb_template;



More information about the postgis-tickets mailing list