FROM raster_nmapalgebra_in
WHERE rid IN (3,4);
+-- NOTE OFFSET 0 is in place to force PostgreSQL 12+ to materialized CTE as it did in older versions
+-- otherwise get extra notices
WITH foo AS (
SELECT
rid,
1, 1
) AS rast
FROM raster_nmapalgebra_in
- WHERE rid IN (3,4)
+ WHERE rid IN (3,4) OFFSET 0
)
SELECT
rid,
DO $$ DECLARE r record;
BEGIN
+-- NOTE: added OFFSET 0 to CTE clauses to force PostgreSQL 12+ to materialize like old versions did
-- this ONLY works for PostgreSQL version 9.1 or higher
IF array_to_string(regexp_matches(split_part(version(), ' ', 2), E'([0-9]+)\.([0-9]+)'), '')::int > 90 THEN
WITH foo AS (
WHERE t1.rid = 10
AND t2.rid BETWEEN 10 AND 18
AND ST_Intersects(t1.rast, t2.rast)
- GROUP BY t1.rid, t1.rast
+ GROUP BY t1.rid, t1.rast OFFSET 0
)
SELECT
rid,
WHERE t1.rid = 14
AND t2.rid BETWEEN 10 AND 18
AND ST_Intersects(t1.rast, t2.rast)
- GROUP BY t1.rid, t1.rast
+ GROUP BY t1.rid, t1.rast OFFSET 0
)
SELECT
rid,
WHERE t1.rid = 17
AND t2.rid BETWEEN 10 AND 18
AND ST_Intersects(t1.rast, t2.rast)
- GROUP BY t1.rid, t1.rast
+ GROUP BY t1.rid, t1.rast OFFSET 0
)
SELECT
rid,
) AS rast
FROM raster_nmapalgebra_in t1
JOIN foo t2
- ON t1.rid = t2.rid
+ ON t1.rid = t2.rid OFFSET 0
)
SELECT
rid,
) AS rast
FROM raster_nmapalgebra_in t1
JOIN foo t2
- ON t1.rid = t2.rid
+ ON t1.rid = t2.rid OFFSET 0
)
SELECT
rid,
) AS rast
FROM raster_nmapalgebra_in t1
JOIN foo t2
- ON t1.rid = t2.rid
+ ON t1.rid = t2.rid OFFSET 0
)
SELECT
rid,
FROM raster_nmapalgebra_in t1
CROSS JOIN raster_nmapalgebra_in t2
WHERE t1.rid = 20
- AND t2.rid = 21
+ AND t2.rid = 21 OFFSET 0
)
SELECT
rid1,
FROM raster_nmapalgebra_in t1
CROSS JOIN raster_nmapalgebra_in t2
WHERE t1.rid = 20
- AND t2.rid = 22
+ AND t2.rid = 22 OFFSET 0
)
SELECT
rid1,
FROM raster_nmapalgebra_in t1
CROSS JOIN raster_nmapalgebra_in t2
WHERE t1.rid = 21
- AND t2.rid = 22
+ AND t2.rid = 22 OFFSET 0
)
SELECT
rid1,
FROM raster_nmapalgebra_in t1
CROSS JOIN raster_nmapalgebra_in t2
WHERE t1.rid = 20
- AND t2.rid = 21
+ AND t2.rid = 21 OFFSET 0
)
SELECT
rid1,
FROM raster_nmapalgebra_in t1
CROSS JOIN raster_nmapalgebra_in t2
WHERE t1.rid = 20
- AND t2.rid = 22
+ AND t2.rid = 22 OFFSET 0
)
SELECT
rid1,
CROSS JOIN raster_nmapalgebra_in t3
WHERE t1.rid = 20
AND t2.rid = 21
- AND t3.rid = 22
+ AND t3.rid = 22 OFFSET 0
)
SELECT
rid1,
CROSS JOIN raster_nmapalgebra_in t3
WHERE t1.rid = 20
AND t2.rid = 21
- AND t3.rid = 22
+ AND t3.rid = 22 OFFSET 0
)
SELECT
rid1,
CROSS JOIN raster_nmapalgebra_in t3
WHERE t1.rid = 20
AND t2.rid = 21
- AND t3.rid = 22
+ AND t3.rid = 22 OFFSET 0
)
SELECT
rid1,
CROSS JOIN raster_nmapalgebra_in t3
WHERE t1.rid = 20
AND t2.rid = 21
- AND t3.rid = 22
+ AND t3.rid = 22 OFFSET 0
)
SELECT
rid1,
CROSS JOIN raster_nmapalgebra_in t3
WHERE t1.rid = 20
AND t2.rid = 21
- AND t3.rid = 22
+ AND t3.rid = 22 OFFSET 0
)
SELECT
rid1,
'raster_nmapalgebra_test(double precision[], int[], text[])'::regprocedure
) AS rast
FROM raster_nmapalgebra_in t1
- WHERE t1.rid = 30
+ WHERE t1.rid = 30 OFFSET 0
)
SELECT
rid,
'raster_nmapalgebra_test(double precision[], int[], text[])'::regprocedure
) AS rast
FROM raster_nmapalgebra_in t1
- WHERE t1.rid = 30
+ WHERE t1.rid = 30 OFFSET 0
)
SELECT
rid,
'16BUI'::text
) AS rast
FROM raster_nmapalgebra_in t1
- WHERE t1.rid = 31
+ WHERE t1.rid = 31 OFFSET 0
)
SELECT
rid,
FROM raster_nmapalgebra_in t1
CROSS JOIN raster_nmapalgebra_in t2
WHERE t1.rid = 30
- AND t2.rid = 31
+ AND t2.rid = 31 OFFSET 0
)
SELECT
rid1,
'raster_nmapalgebra_test(double precision[], int[], text[])'::regprocedure
) AS rast
FROM raster_nmapalgebra_in t1
- WHERE t1.rid = 30
+ WHERE t1.rid = 30 OFFSET 0
)
SELECT
rid,
'raster_nmapalgebra_test(double precision[], int[], text[])'::regprocedure
) AS rast
FROM raster_nmapalgebra_in t1
- WHERE t1.rid = 30
+ WHERE t1.rid = 30 OFFSET 0
)
SELECT
rid,