Added return statements when missing
This commit is contained in:
@@ -172,6 +172,7 @@ BEGIN
|
|||||||
RAISE NOTICE 'Point % is outside of the data region', ST_AsText(geom);
|
RAISE NOTICE 'Point % is outside of the data region', ST_AsText(geom);
|
||||||
-- TODO this should return JSON
|
-- TODO this should return JSON
|
||||||
RETURN QUERY SELECT '{}'::text[], '{}'::NUMERIC[];
|
RETURN QUERY SELECT '{}'::text[], '{}'::NUMERIC[];
|
||||||
|
RETURN;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
IF data_table_info IS NULL THEN
|
IF data_table_info IS NULL THEN
|
||||||
@@ -198,6 +199,7 @@ BEGIN
|
|||||||
SELECT unnest($1)
|
SELECT unnest($1)
|
||||||
$query$
|
$query$
|
||||||
USING results;
|
USING results;
|
||||||
|
RETURN;
|
||||||
|
|
||||||
END;
|
END;
|
||||||
$$ LANGUAGE plpgsql;
|
$$ LANGUAGE plpgsql;
|
||||||
@@ -722,6 +724,7 @@ BEGIN
|
|||||||
THEN
|
THEN
|
||||||
RAISE NOTICE 'Point % is outside of the data region', ST_AsText(geom);
|
RAISE NOTICE 'Point % is outside of the data region', ST_AsText(geom);
|
||||||
RETURN QUERY SELECT '{}'::text[], '{}'::text[];
|
RETURN QUERY SELECT '{}'::text[], '{}'::text[];
|
||||||
|
RETURN;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
EXECUTE '
|
EXECUTE '
|
||||||
@@ -735,6 +738,7 @@ BEGIN
|
|||||||
THEN
|
THEN
|
||||||
RAISE NOTICE 'No data table found for this location';
|
RAISE NOTICE 'No data table found for this location';
|
||||||
RETURN QUERY SELECT NULL::json;
|
RETURN QUERY SELECT NULL::json;
|
||||||
|
RETURN;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
EXECUTE
|
EXECUTE
|
||||||
@@ -749,6 +753,7 @@ BEGIN
|
|||||||
THEN
|
THEN
|
||||||
RAISE NOTICE 'No geometry id for this location';
|
RAISE NOTICE 'No geometry id for this location';
|
||||||
RETURN QUERY SELECT NULL::json;
|
RETURN QUERY SELECT NULL::json;
|
||||||
|
RETURN;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
query := 'SELECT ARRAY[';
|
query := 'SELECT ARRAY[';
|
||||||
|
|||||||
@@ -274,6 +274,7 @@ BEGIN
|
|||||||
THEN
|
THEN
|
||||||
RAISE NOTICE 'No boundaries found for bounding box ''%'' in ''%''', ST_AsText(geom), boundary_id;
|
RAISE NOTICE 'No boundaries found for bounding box ''%'' in ''%''', ST_AsText(geom), boundary_id;
|
||||||
RETURN QUERY SELECT NULL::geometry, NULL::text;
|
RETURN QUERY SELECT NULL::geometry, NULL::text;
|
||||||
|
RETURN;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
RAISE NOTICE 'target_table: %', target_table;
|
RAISE NOTICE 'target_table: %', target_table;
|
||||||
@@ -286,6 +287,7 @@ BEGIN
|
|||||||
WHERE ST_%s($1, the_geom)
|
WHERE ST_%s($1, the_geom)
|
||||||
', geom_colname, geoid_colname, target_table, overlap_type)
|
', geom_colname, geoid_colname, target_table, overlap_type)
|
||||||
USING geom;
|
USING geom;
|
||||||
|
RETURN;
|
||||||
|
|
||||||
END;
|
END;
|
||||||
$$ LANGUAGE plpgsql;
|
$$ LANGUAGE plpgsql;
|
||||||
@@ -328,6 +330,7 @@ BEGIN
|
|||||||
time_span,
|
time_span,
|
||||||
overlap_type
|
overlap_type
|
||||||
);
|
);
|
||||||
|
RETURN;
|
||||||
|
|
||||||
END;
|
END;
|
||||||
$$ LANGUAGE plpgsql;
|
$$ LANGUAGE plpgsql;
|
||||||
@@ -380,6 +383,7 @@ BEGIN
|
|||||||
circle_boundary,
|
circle_boundary,
|
||||||
boundary_id,
|
boundary_id,
|
||||||
time_span);
|
time_span);
|
||||||
|
RETURN;
|
||||||
END;
|
END;
|
||||||
$$ LANGUAGE plpgsql;
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
@@ -416,6 +420,7 @@ BEGIN
|
|||||||
THEN
|
THEN
|
||||||
RAISE NOTICE 'No boundaries found for bounding box ''%'' in ''%''', ST_AsText(geom), boundary_id;
|
RAISE NOTICE 'No boundaries found for bounding box ''%'' in ''%''', ST_AsText(geom), boundary_id;
|
||||||
RETURN QUERY SELECT NULL::geometry, NULL::text;
|
RETURN QUERY SELECT NULL::geometry, NULL::text;
|
||||||
|
RETURN;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
RAISE NOTICE 'target_table: %', target_table;
|
RAISE NOTICE 'target_table: %', target_table;
|
||||||
@@ -428,6 +433,7 @@ BEGIN
|
|||||||
WHERE ST_%s($1, the_geom)
|
WHERE ST_%s($1, the_geom)
|
||||||
', geom_colname, geom_colname, geoid_colname, target_table, overlap_type)
|
', geom_colname, geom_colname, geoid_colname, target_table, overlap_type)
|
||||||
USING geom;
|
USING geom;
|
||||||
|
RETURN;
|
||||||
|
|
||||||
END;
|
END;
|
||||||
$$ LANGUAGE plpgsql;
|
$$ LANGUAGE plpgsql;
|
||||||
@@ -469,6 +475,7 @@ BEGIN
|
|||||||
boundary_id,
|
boundary_id,
|
||||||
time_span,
|
time_span,
|
||||||
overlap_type);
|
overlap_type);
|
||||||
|
RETURN;
|
||||||
|
|
||||||
END;
|
END;
|
||||||
$$ LANGUAGE plpgsql;
|
$$ LANGUAGE plpgsql;
|
||||||
@@ -522,6 +529,7 @@ BEGIN
|
|||||||
boundary_id,
|
boundary_id,
|
||||||
time_span,
|
time_span,
|
||||||
overlap_type);
|
overlap_type);
|
||||||
|
RETURN;
|
||||||
END;
|
END;
|
||||||
$$ LANGUAGE plpgsql;
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
@@ -560,6 +568,7 @@ BEGIN
|
|||||||
-- AND geom_t.timespan = '%s' <-- put in requested year
|
-- AND geom_t.timespan = '%s' <-- put in requested year
|
||||||
-- TODO: filter by clipped vs. not so appropriate tablename are unique
|
-- TODO: filter by clipped vs. not so appropriate tablename are unique
|
||||||
-- so the limit 1 can be removed
|
-- so the limit 1 can be removed
|
||||||
|
RETURN;
|
||||||
|
|
||||||
END;
|
END;
|
||||||
$$ LANGUAGE plpgsql;
|
$$ LANGUAGE plpgsql;
|
||||||
|
|||||||
Reference in New Issue
Block a user