Commit 131c2442 authored by Bborie Park's avatar Bborie Park

DO block to emit message. ticket #3118

git-svn-id: http://svn.osgeo.org/postgis/[email protected] b70326c6-7e19-0410-871a-916f4a2858ee
parent 5d334557
......@@ -7572,6 +7572,8 @@ CREATE OR REPLACE FUNCTION _raster_constraint_info_nodata_values(rastschema name
$$ LANGUAGE sql STABLE STRICT
COST 100;
-- Availability: 2.0.0
-- Changed: 2.2.0
CREATE OR REPLACE FUNCTION _raster_constraint_nodata_values(rast raster)
RETURNS numeric[] AS
$$ SELECT array_agg(round(nodatavalue::numeric, 10))::numeric[] FROM st_bandmetadata($1, ARRAY[]::int[]); $$
......
......@@ -578,4 +578,24 @@ DROP FUNCTION IF EXISTS _st_hillshade4ma(float8[], text, text[]);
DROP FUNCTION IF EXISTS _st_slope4ma(float8[], text, text[]);
-- function signature change
DROP FUNCTION IF EXISTS _raster_constraint_nodata_values(rast raster);
-- return value changed
DO LANGUAGE 'plpgsql' $$
DECLARE
cnt bigint;
BEGIN
SELECT
count(*)
INTO cnt
FROM pg_proc f
JOIN pg_type t
ON f.prorettype = t.oid
WHERE lower(f.proname) = '_raster_constraint_nodata_values'
AND f.pronargs = 1
AND t.typname = '_float8'; -- array form
IF cnt > 0 THEN
RAISE NOTICE 'Dropping _raster_constraint_nodata_values(raster) due to return value changes. Unfortunately, this is a DROP ... CASCADE as the NODATA raster constraint uses _raster_constraint_nodata_values(raster). You will need to reapply AddRasterConstraint(''SCHEMA'', ''TABLE'', ''COLUMN'', ''nodata'') to any raster column that requires this constraint.';
DROP FUNCTION IF EXISTS _raster_constraint_nodata_values(raster) CASCADE;
END IF;
END;
$$;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment