diff --git a/NEWS.md b/NEWS.md index 15d316e..bfbb82e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,11 @@ +1.0.4 (2016-07-26) + +__Bugfixes__ + +* Always default arguments to `NULL`, which prevents duplication & overwrite by + dataservices-api + ([#173](https://github.com/CartoDB/observatory-extension/issues/173)) + 1.0.3 (2016-07-25) __Bugfixes__ diff --git a/src/pg/observatory.control b/src/pg/observatory.control index a97eced..20d9a45 100644 --- a/src/pg/observatory.control +++ b/src/pg/observatory.control @@ -1,5 +1,5 @@ comment = 'CartoDB Observatory backend extension' -default_version = '1.0.3' +default_version = '1.0.4' requires = 'postgis, postgres_fdw' superuser = true schema = cdb_observatory diff --git a/src/pg/sql/44_observatory_geometries.sql b/src/pg/sql/44_observatory_geometries.sql index 0ca42d4..dd962f9 100644 --- a/src/pg/sql/44_observatory_geometries.sql +++ b/src/pg/sql/44_observatory_geometries.sql @@ -244,7 +244,7 @@ CREATE OR REPLACE FUNCTION cdb_observatory._OBS_GetBoundariesByGeometry( geom geometry(Geometry, 4326), boundary_id text, time_span text DEFAULT NULL, - overlap_type text DEFAULT 'intersects') + overlap_type text DEFAULT NULL) RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ DECLARE @@ -253,7 +253,7 @@ DECLARE geoid_colname text; target_table text; BEGIN - + overlap_type := COALESCE(overlap_type, 'intersects'); -- check inputs IF lower(overlap_type) NOT IN ('contains', 'intersects', 'within') THEN @@ -318,7 +318,7 @@ CREATE OR REPLACE FUNCTION cdb_observatory.OBS_GetBoundariesByGeometry( geom geometry(Geometry, 4326), boundary_id text, time_span text DEFAULT NULL, - overlap_type text DEFAULT 'intersects') + overlap_type text DEFAULT NULL) RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ BEGIN @@ -364,7 +364,7 @@ CREATE OR REPLACE FUNCTION cdb_observatory.OBS_GetBoundariesByPointAndRadius( radius numeric, -- radius in meters boundary_id text, time_span text DEFAULT NULL, - overlap_type text DEFAULT 'intersects') + overlap_type text DEFAULT NULL) RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ DECLARE @@ -382,7 +382,8 @@ BEGIN FROM cdb_observatory._OBS_GetBoundariesByGeometry( circle_boundary, boundary_id, - time_span); + time_span, + overlap_type); RETURN; END; $$ LANGUAGE plpgsql; @@ -394,7 +395,7 @@ CREATE OR REPLACE FUNCTION cdb_observatory._OBS_GetPointsByGeometry( geom geometry(Geometry, 4326), boundary_id text, time_span text DEFAULT NULL, - overlap_type text DEFAULT 'intersects') + overlap_type text DEFAULT NULL) RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ DECLARE @@ -403,6 +404,7 @@ DECLARE geoid_colname text; target_table text; BEGIN + overlap_type := COALESCE(overlap_type, 'intersects'); IF lower(overlap_type) NOT IN ('contains', 'within', 'intersects') THEN @@ -464,7 +466,7 @@ CREATE OR REPLACE FUNCTION cdb_observatory.OBS_GetPointsByGeometry( geom geometry(Geometry, 4326), boundary_id text, time_span text DEFAULT NULL, - overlap_type text DEFAULT 'intersects') + overlap_type text DEFAULT NULL) RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ BEGIN @@ -509,7 +511,7 @@ CREATE OR REPLACE FUNCTION cdb_observatory.OBS_GetPointsByPointAndRadius( radius numeric, -- radius in meters boundary_id text, time_span text DEFAULT NULL, - overlap_type text DEFAULT 'intersects') + overlap_type text DEFAULT NULL) RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ DECLARE