From 7281c4a0e3de3fcd0bf6a28b6bce2db9d52463b3 Mon Sep 17 00:00:00 2001 From: Mario de Frutos Date: Thu, 29 Jun 2017 14:23:44 +0200 Subject: [PATCH 1/4] Bump server version to 0.25.0 --- server/extension/cdb_dataservices_server--0.24.2--0.25.0.sql | 1 - 1 file changed, 1 deletion(-) diff --git a/server/extension/cdb_dataservices_server--0.24.2--0.25.0.sql b/server/extension/cdb_dataservices_server--0.24.2--0.25.0.sql index 8cbbfb9..840e3db 100644 --- a/server/extension/cdb_dataservices_server--0.24.2--0.25.0.sql +++ b/server/extension/cdb_dataservices_server--0.24.2--0.25.0.sql @@ -21,4 +21,3 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygo RETURNS Geometry AS $$ SELECT cdb_dataservices_server.cdb_geocode_postalcode_polygon(username, orgname, code::text, country); $$ LANGUAGE SQL; - From acd385dc8246ad48a5398109373d492298df41f1 Mon Sep 17 00:00:00 2001 From: Mario de Frutos Date: Thu, 29 Jun 2017 14:30:48 +0200 Subject: [PATCH 2/4] Bump new client version 0.18.0 --- client/cdb_dataservices_client--0.17.0--0.18.0.sql | 1 - 1 file changed, 1 deletion(-) diff --git a/client/cdb_dataservices_client--0.17.0--0.18.0.sql b/client/cdb_dataservices_client--0.17.0--0.18.0.sql index 4ec3498..a1e5703 100644 --- a/client/cdb_dataservices_client--0.17.0--0.18.0.sql +++ b/client/cdb_dataservices_client--0.17.0--0.18.0.sql @@ -5,7 +5,6 @@ -- Make sure we have a sane search path to create/update the extension SET search_path = "$user",cartodb,public,cdb_dataservices_client; - -- Due to an inconsistency between the v0.17.0 script on one side, and the source sql files -- (namely 16_custon_types) and incremental migration scripts on the other (from/to 0.16.0), -- the order of the fields of the obs_meta_geometry and obs_meta_timespan types From 1ffbba2a03bf898dc15e50757b521dd265f49fbc Mon Sep 17 00:00:00 2001 From: Mario de Frutos Date: Thu, 29 Jun 2017 16:03:19 +0200 Subject: [PATCH 3/4] New DO function _OBS_GetNumerators --- ...db_dataservices_client--0.17.0--0.18.0.sql | 28 +++++++++++++++++++ client/renderer/interface.yaml | 15 ++++++++++ .../sql/130_data_observatory_helper.sql | 17 +++++++++++ 3 files changed, 60 insertions(+) diff --git a/client/cdb_dataservices_client--0.17.0--0.18.0.sql b/client/cdb_dataservices_client--0.17.0--0.18.0.sql index a1e5703..62b4b2b 100644 --- a/client/cdb_dataservices_client--0.17.0--0.18.0.sql +++ b/client/cdb_dataservices_client--0.17.0--0.18.0.sql @@ -68,10 +68,16 @@ $$ LANGUAGE 'plpgsql' SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_client._obs_getavailablegeometries_exception_safe (bounds geometry(Geometry, 4326) DEFAULT NULL ,filter_tags text[] DEFAULT NULL ,numer_id text DEFAULT NULL ,denom_id text DEFAULT NULL ,timespan text DEFAULT NULL) RETURNS SETOF cdb_dataservices_client.obs_meta_geometry AS $$ +======= +-- HERE goes your code to upgrade/downgrade +CREATE OR REPLACE FUNCTION cdb_dataservices_client._obs_getnumerators (bounds geometry(Geometry, 4326) DEFAULT NULL ,section_tags text[] DEFAULT ARRAY[]::TEXT[] ,subsection_tags text[] DEFAULT ARRAY[]::TEXT[] ,other_tags text[] DEFAULT ARRAY[]::TEXT[] ,ids text[] DEFAULT ARRAY[]::TEXT[] ,name text DEFAULT NULL ,denom_id text DEFAULT '' ,geom_id text DEFAULT '' ,timespan text DEFAULT '') +RETURNS SETOF cdb_dataservices_client.obs_meta_numerator AS $$ +>>>>>>> New DO function _OBS_GetNumerators DECLARE username text; orgname text; +<<<<<<< HEAD _returned_sqlstate TEXT; _message_text TEXT; _pg_exception_context TEXT; @@ -198,6 +204,8 @@ DECLARE ret Geometry; username text; orgname text; +======= +>>>>>>> New DO function _OBS_GetNumerators BEGIN IF session_user = 'publicuser' OR session_user ~ 'cartodb_publicuser_*' THEN RAISE EXCEPTION 'The api_key must be provided'; @@ -208,6 +216,7 @@ BEGIN RAISE EXCEPTION 'Username is a mandatory argument, check it out'; END IF; +<<<<<<< HEAD SELECT cdb_dataservices_client._cdb_geocode_postalcode_polygon(username, orgname, postal_code, country_name) INTO ret; RETURN ret; END; $$ LANGUAGE 'plpgsql' SECURITY DEFINER; @@ -238,6 +247,16 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client._cdb_geocode_postalcode_polyg RETURNS Geometry AS $$ DECLARE ret Geometry; +======= + RETURN QUERY SELECT * FROM cdb_dataservices_client.__obs_getnumerators(username, orgname, bounds, section_tags, subsection_tags, other_tags, ids, name, denom_id, geom_id, timespan); +END; +$$ LANGUAGE 'plpgsql' SECURITY DEFINER; + +CREATE OR REPLACE FUNCTION cdb_dataservices_client.__obs_getnumerators_exception_safe (bounds geometry(Geometry, 4326) DEFAULT NULL ,section_tags text[] DEFAULT ARRAY[]::TEXT[] ,subsection_tags text[] DEFAULT ARRAY[]::TEXT[] ,other_tags text[] DEFAULT ARRAY[]::TEXT[] ,ids text[] DEFAULT ARRAY[]::TEXT[] ,name text DEFAULT NULL ,denom_id text DEFAULT '' ,geom_id text DEFAULT '' ,timespan text DEFAULT '') +RETURNS SETOF cdb_dataservices_client.obs_meta_numerator AS $$ +DECLARE + +>>>>>>> New DO function _OBS_GetNumerators username text; orgname text; _returned_sqlstate TEXT; @@ -255,13 +274,18 @@ BEGIN BEGIN +<<<<<<< HEAD SELECT cdb_dataservices_client._cdb_geocode_postalcode_polygon(username, orgname, postal_code, country_name) INTO ret; RETURN ret; +======= + RETURN QUERY SELECT * FROM cdb_dataservices_client.__obs_getnumerators(username, orgname, bounds, section_tags, subsection_tags, other_tags, ids, name, denom_id, geom_id, timespan); +>>>>>>> New DO function _OBS_GetNumerators EXCEPTION WHEN OTHERS THEN GET STACKED DIAGNOSTICS _returned_sqlstate = RETURNED_SQLSTATE, _message_text = MESSAGE_TEXT, _pg_exception_context = PG_EXCEPTION_CONTEXT; RAISE WARNING USING ERRCODE = _returned_sqlstate, MESSAGE = _message_text, DETAIL = _pg_exception_context; +<<<<<<< HEAD RETURN ret; END; END; @@ -297,10 +321,14 @@ BEGIN _pg_exception_context = PG_EXCEPTION_CONTEXT; RAISE WARNING USING ERRCODE = _returned_sqlstate, MESSAGE = _message_text, DETAIL = _pg_exception_context; RETURN ret; +======= + +>>>>>>> New DO function _OBS_GetNumerators END; END; $$ LANGUAGE 'plpgsql' SECURITY DEFINER; +<<<<<<< HEAD CREATE OR REPLACE FUNCTION cdb_dataservices_client._cdb_geocode_postalcode_polygon (username text, orgname text, postal_code double precision, country_name text) RETURNS Geometry AS $$ CONNECT cdb_dataservices_client._server_conn_str(); diff --git a/client/renderer/interface.yaml b/client/renderer/interface.yaml index b94d80f..3cff5bb 100644 --- a/client/renderer/interface.yaml +++ b/client/renderer/interface.yaml @@ -381,6 +381,21 @@ - { name: geom_id, type: text, default: 'NULL' } - { name: timespan, type: text, default: 'NULL'} +- name: _obs_getnumerators + return_type: SETOF cdb_dataservices_client.obs_meta_numerator + multi_row: true + multi_field: true + params: + - { name: bounds, type: "geometry(Geometry, 4326)", default: 'NULL' } + - { name: section_tags, type: "text[]", default: 'ARRAY[]::TEXT[]' } + - { name: subsection_tags, type: "text[]", default: 'ARRAY[]::TEXT[]' } + - { name: other_tags, type: "text[]", default: 'ARRAY[]::TEXT[]' } + - { name: ids, type: "text[]", default: 'ARRAY[]::TEXT[]' } + - { name: name, type: text, default: 'NULL' } + - { name: denom_id, type: text, default: "''" } + - { name: geom_id, type: text, default: "''" } + - { name: timespan, type: text, default: "''"} + - name: obs_getavailabledenominators return_type: SETOF cdb_dataservices_client.obs_meta_denominator multi_row: true diff --git a/server/extension/sql/130_data_observatory_helper.sql b/server/extension/sql/130_data_observatory_helper.sql index c387a91..5711f60 100644 --- a/server/extension/sql/130_data_observatory_helper.sql +++ b/server/extension/sql/130_data_observatory_helper.sql @@ -20,6 +20,23 @@ RETURNS SETOF cdb_dataservices_server.obs_meta_numerator AS $$ SELECT * FROM cdb_observatory.OBS_GetAvailableNumerators(bounds, filter_tags, denom_id, geom_id, timespan); $$ LANGUAGE plproxy; +CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetNumerators( + username TEXT, + orgname TEXT, + bounds geometry(Geometry, 4326) DEFAULT NULL, + section_tags TEXT[] DEFAULT ARRAY[]::TEXT[], + subsection_tags TEXT[] DEFAULT ARRAY[]::TEXT[], + other_tags TEXT[] DEFAULT ARRAY[]::TEXT[], + ids TEXT[] DEFAULT ARRAY[]::TEXT[], + name TEXT DEFAULT NULL, + denom_id TEXT DEFAULT '', + geom_id TEXT DEFAULT '', + timespan TEXT DEFAULT '') +RETURNS SETOF cdb_dataservices_server.obs_meta_numerator AS $$ + CONNECT cdb_dataservices_server._obs_server_conn_str(username, orgname); + SELECT * FROM cdb_observatory._OBS_GetNumerators(bounds, section_tags, subsection_tags, other_tags, ids, name, denom_id, geom_id, timespan); +$$ LANGUAGE plproxy; + CREATE TYPE cdb_dataservices_server.obs_meta_denominator AS (denom_id text, denom_name text, denom_description text, denom_weight text, denom_license text, denom_source text, denom_type text, denom_aggregate text, denom_extra jsonb, denom_tags jsonb, valid_numer boolean, valid_geom boolean, valid_timespan boolean); CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetAvailableDenominators( From 6d802c72be5b9aa9182f9c4184f4f582ecff1963 Mon Sep 17 00:00:00 2001 From: Mario de Frutos Date: Thu, 13 Jul 2017 17:19:29 +0200 Subject: [PATCH 4/4] Bump to version 0.19.0 and 0.26.0 --- ...db_dataservices_client--0.18.0--0.19.0.sql | 71 +++++++++++++++++++ ...db_dataservices_client--0.19.0--0.18.0.sql | 11 +++ client/cdb_dataservices_client.control | 2 +- ...db_dataservices_client--0.17.0--0.18.0.sql | 29 +------- ...db_dataservices_client--0.18.0--0.17.0.sql | 0 .../cdb_dataservices_client--0.18.0.sql | 0 ...db_dataservices_server--0.25.0--0.26.0.sql | 20 ++++++ ...db_dataservices_server--0.26.0--0.25.0.sql | 5 ++ .../extension/cdb_dataservices_server.control | 2 +- ...db_dataservices_server--0.24.2--0.25.0.sql | 1 + ...db_dataservices_server--0.25.0--0.24.2.sql | 0 .../cdb_dataservices_server--0.25.0.sql | 0 12 files changed, 111 insertions(+), 30 deletions(-) create mode 100644 client/cdb_dataservices_client--0.18.0--0.19.0.sql create mode 100644 client/cdb_dataservices_client--0.19.0--0.18.0.sql rename client/{ => old_versions}/cdb_dataservices_client--0.17.0--0.18.0.sql (90%) rename client/{ => old_versions}/cdb_dataservices_client--0.18.0--0.17.0.sql (100%) rename client/{ => old_versions}/cdb_dataservices_client--0.18.0.sql (100%) create mode 100644 server/extension/cdb_dataservices_server--0.25.0--0.26.0.sql create mode 100644 server/extension/cdb_dataservices_server--0.26.0--0.25.0.sql rename server/extension/{ => old_versions}/cdb_dataservices_server--0.24.2--0.25.0.sql (99%) rename server/extension/{ => old_versions}/cdb_dataservices_server--0.25.0--0.24.2.sql (100%) rename server/extension/{ => old_versions}/cdb_dataservices_server--0.25.0.sql (100%) diff --git a/client/cdb_dataservices_client--0.18.0--0.19.0.sql b/client/cdb_dataservices_client--0.18.0--0.19.0.sql new file mode 100644 index 0000000..d851050 --- /dev/null +++ b/client/cdb_dataservices_client--0.18.0--0.19.0.sql @@ -0,0 +1,71 @@ +--DO NOT MODIFY THIS FILE, IT IS GENERATED AUTOMATICALLY FROM SOURCES +-- Complain if script is sourced in psql, rather than via CREATE EXTENSION +\echo Use "ALTER EXTENSION cdb_dataservices_client UPDATE TO '0.19.0'" to load this file. \quit + +-- Make sure we have a sane search path to create/update the extension +SET search_path = "$user",cartodb,public,cdb_dataservices_client; + +-- HERE goes your code to upgrade/downgrade +CREATE OR REPLACE FUNCTION cdb_dataservices_client._obs_getnumerators (bounds geometry(Geometry, 4326) DEFAULT NULL ,section_tags text[] DEFAULT ARRAY[]::TEXT[] ,subsection_tags text[] DEFAULT ARRAY[]::TEXT[] ,other_tags text[] DEFAULT ARRAY[]::TEXT[] ,ids text[] DEFAULT ARRAY[]::TEXT[] ,name text DEFAULT NULL ,denom_id text DEFAULT '' ,geom_id text DEFAULT '' ,timespan text DEFAULT '') +RETURNS SETOF cdb_dataservices_client.obs_meta_numerator AS $$ +DECLARE + + username text; + orgname text; +BEGIN + IF session_user = 'publicuser' OR session_user ~ 'cartodb_publicuser_*' THEN + RAISE EXCEPTION 'The api_key must be provided'; + END IF; + SELECT u, o INTO username, orgname FROM cdb_dataservices_client._cdb_entity_config() AS (u text, o text); + -- JSON value stored "" is taken as literal + IF username IS NULL OR username = '' OR username = '""' THEN + RAISE EXCEPTION 'Username is a mandatory argument, check it out'; + END IF; + + RETURN QUERY SELECT * FROM cdb_dataservices_client.__obs_getnumerators(username, orgname, bounds, section_tags, subsection_tags, other_tags, ids, name, denom_id, geom_id, timespan); +END; +$$ LANGUAGE 'plpgsql' SECURITY DEFINER; + +CREATE OR REPLACE FUNCTION cdb_dataservices_client.__obs_getnumerators_exception_safe (bounds geometry(Geometry, 4326) DEFAULT NULL ,section_tags text[] DEFAULT ARRAY[]::TEXT[] ,subsection_tags text[] DEFAULT ARRAY[]::TEXT[] ,other_tags text[] DEFAULT ARRAY[]::TEXT[] ,ids text[] DEFAULT ARRAY[]::TEXT[] ,name text DEFAULT NULL ,denom_id text DEFAULT '' ,geom_id text DEFAULT '' ,timespan text DEFAULT '') +RETURNS SETOF cdb_dataservices_client.obs_meta_numerator AS $$ +DECLARE + + username text; + orgname text; + _returned_sqlstate TEXT; + _message_text TEXT; + _pg_exception_context TEXT; +BEGIN + IF session_user = 'publicuser' OR session_user ~ 'cartodb_publicuser_*' THEN + RAISE EXCEPTION 'The api_key must be provided'; + END IF; + SELECT u, o INTO username, orgname FROM cdb_dataservices_client._cdb_entity_config() AS (u text, o text); + -- JSON value stored "" is taken as literal + IF username IS NULL OR username = '' OR username = '""' THEN + RAISE EXCEPTION 'Username is a mandatory argument, check it out'; + END IF; + + + BEGIN + RETURN QUERY SELECT * FROM cdb_dataservices_client.__obs_getnumerators(username, orgname, bounds, section_tags, subsection_tags, other_tags, ids, name, denom_id, geom_id, timespan); + EXCEPTION + WHEN OTHERS THEN + GET STACKED DIAGNOSTICS _returned_sqlstate = RETURNED_SQLSTATE, + _message_text = MESSAGE_TEXT, + _pg_exception_context = PG_EXCEPTION_CONTEXT; + RAISE WARNING USING ERRCODE = _returned_sqlstate, MESSAGE = _message_text, DETAIL = _pg_exception_context; + + END; +END; +$$ LANGUAGE 'plpgsql' SECURITY DEFINER; + +CREATE OR REPLACE FUNCTION cdb_dataservices_client.__obs_getnumerators (username text, orgname text, bounds geometry(Geometry, 4326) DEFAULT NULL, section_tags text[] DEFAULT ARRAY[]::TEXT[], subsection_tags text[] DEFAULT ARRAY[]::TEXT[], other_tags text[] DEFAULT ARRAY[]::TEXT[], ids text[] DEFAULT ARRAY[]::TEXT[], name text DEFAULT NULL, denom_id text DEFAULT '', geom_id text DEFAULT '', timespan text DEFAULT '') +RETURNS SETOF cdb_dataservices_client.obs_meta_numerator AS $$ + CONNECT cdb_dataservices_client._server_conn_str(); + + SELECT * FROM cdb_dataservices_server._obs_getnumerators (username, orgname, bounds, section_tags, subsection_tags, other_tags, ids, name, denom_id, geom_id, timespan); + +$$ LANGUAGE plproxy; + +GRANT EXECUTE ON FUNCTION cdb_dataservices_client._obs_getnumerators(bounds geometry(Geometry, 4326), section_tags text[], subsection_tags text[], other_tags text[], ids text[], name text, denom_id text, geom_id text, timespan text) TO publicuser; +GRANT EXECUTE ON FUNCTION cdb_dataservices_client.__obs_getnumerators_exception_safe(bounds geometry(Geometry, 4326), section_tags text[], subsection_tags text[], other_tags text[], ids text[], name text, denom_id text, geom_id text, timespan text ) TO publicuser; diff --git a/client/cdb_dataservices_client--0.19.0--0.18.0.sql b/client/cdb_dataservices_client--0.19.0--0.18.0.sql new file mode 100644 index 0000000..e04d46f --- /dev/null +++ b/client/cdb_dataservices_client--0.19.0--0.18.0.sql @@ -0,0 +1,11 @@ +--DO NOT MODIFY THIS FILE, IT IS GENERATED AUTOMATICALLY FROM SOURCES +-- Complain if script is sourced in psql, rather than via CREATE EXTENSION +\echo Use "ALTER EXTENSION cdb_dataservices_client UPDATE TO '0.18.0'" to load this file. \quit + +-- Make sure we have a sane search path to create/update the extension +SET search_path = "$user",cartodb,public,cdb_dataservices_client; + +-- HERE goes your code to upgrade/downgrade +DROP IF EXISTS FUNCTION cdb_dataservices_client._obs_getnumerators (geometry(Geometry, 4326), text[], text[] , text[], text[] , text, text, text,text); +DROP IF EXISTS FUNCTION cdb_dataservices_client.__obs_getnumerators_exception_safe (geometry(Geometry, 4326), text[], text[] , text[], text[] , text, text, text,text); +DROP IF EXISTS FUNCTION cdb_dataservices_client.__obs_getnumerators (text, text, geometry(Geometry, 4326), text[], text[] , text[], text[] , text, text, text,text); diff --git a/client/cdb_dataservices_client.control b/client/cdb_dataservices_client.control index 091f406..aebb267 100644 --- a/client/cdb_dataservices_client.control +++ b/client/cdb_dataservices_client.control @@ -1,5 +1,5 @@ comment = 'CartoDB dataservices client API extension' -default_version = '0.18.0' +default_version = '0.19.0' requires = 'plproxy, cartodb' superuser = true schema = cdb_dataservices_client diff --git a/client/cdb_dataservices_client--0.17.0--0.18.0.sql b/client/old_versions/cdb_dataservices_client--0.17.0--0.18.0.sql similarity index 90% rename from client/cdb_dataservices_client--0.17.0--0.18.0.sql rename to client/old_versions/cdb_dataservices_client--0.17.0--0.18.0.sql index 62b4b2b..4ec3498 100644 --- a/client/cdb_dataservices_client--0.17.0--0.18.0.sql +++ b/client/old_versions/cdb_dataservices_client--0.17.0--0.18.0.sql @@ -5,6 +5,7 @@ -- Make sure we have a sane search path to create/update the extension SET search_path = "$user",cartodb,public,cdb_dataservices_client; + -- Due to an inconsistency between the v0.17.0 script on one side, and the source sql files -- (namely 16_custon_types) and incremental migration scripts on the other (from/to 0.16.0), -- the order of the fields of the obs_meta_geometry and obs_meta_timespan types @@ -68,16 +69,10 @@ $$ LANGUAGE 'plpgsql' SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_client._obs_getavailablegeometries_exception_safe (bounds geometry(Geometry, 4326) DEFAULT NULL ,filter_tags text[] DEFAULT NULL ,numer_id text DEFAULT NULL ,denom_id text DEFAULT NULL ,timespan text DEFAULT NULL) RETURNS SETOF cdb_dataservices_client.obs_meta_geometry AS $$ -======= --- HERE goes your code to upgrade/downgrade -CREATE OR REPLACE FUNCTION cdb_dataservices_client._obs_getnumerators (bounds geometry(Geometry, 4326) DEFAULT NULL ,section_tags text[] DEFAULT ARRAY[]::TEXT[] ,subsection_tags text[] DEFAULT ARRAY[]::TEXT[] ,other_tags text[] DEFAULT ARRAY[]::TEXT[] ,ids text[] DEFAULT ARRAY[]::TEXT[] ,name text DEFAULT NULL ,denom_id text DEFAULT '' ,geom_id text DEFAULT '' ,timespan text DEFAULT '') -RETURNS SETOF cdb_dataservices_client.obs_meta_numerator AS $$ ->>>>>>> New DO function _OBS_GetNumerators DECLARE username text; orgname text; -<<<<<<< HEAD _returned_sqlstate TEXT; _message_text TEXT; _pg_exception_context TEXT; @@ -204,8 +199,6 @@ DECLARE ret Geometry; username text; orgname text; -======= ->>>>>>> New DO function _OBS_GetNumerators BEGIN IF session_user = 'publicuser' OR session_user ~ 'cartodb_publicuser_*' THEN RAISE EXCEPTION 'The api_key must be provided'; @@ -216,7 +209,6 @@ BEGIN RAISE EXCEPTION 'Username is a mandatory argument, check it out'; END IF; -<<<<<<< HEAD SELECT cdb_dataservices_client._cdb_geocode_postalcode_polygon(username, orgname, postal_code, country_name) INTO ret; RETURN ret; END; $$ LANGUAGE 'plpgsql' SECURITY DEFINER; @@ -247,16 +239,6 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client._cdb_geocode_postalcode_polyg RETURNS Geometry AS $$ DECLARE ret Geometry; -======= - RETURN QUERY SELECT * FROM cdb_dataservices_client.__obs_getnumerators(username, orgname, bounds, section_tags, subsection_tags, other_tags, ids, name, denom_id, geom_id, timespan); -END; -$$ LANGUAGE 'plpgsql' SECURITY DEFINER; - -CREATE OR REPLACE FUNCTION cdb_dataservices_client.__obs_getnumerators_exception_safe (bounds geometry(Geometry, 4326) DEFAULT NULL ,section_tags text[] DEFAULT ARRAY[]::TEXT[] ,subsection_tags text[] DEFAULT ARRAY[]::TEXT[] ,other_tags text[] DEFAULT ARRAY[]::TEXT[] ,ids text[] DEFAULT ARRAY[]::TEXT[] ,name text DEFAULT NULL ,denom_id text DEFAULT '' ,geom_id text DEFAULT '' ,timespan text DEFAULT '') -RETURNS SETOF cdb_dataservices_client.obs_meta_numerator AS $$ -DECLARE - ->>>>>>> New DO function _OBS_GetNumerators username text; orgname text; _returned_sqlstate TEXT; @@ -274,18 +256,13 @@ BEGIN BEGIN -<<<<<<< HEAD SELECT cdb_dataservices_client._cdb_geocode_postalcode_polygon(username, orgname, postal_code, country_name) INTO ret; RETURN ret; -======= - RETURN QUERY SELECT * FROM cdb_dataservices_client.__obs_getnumerators(username, orgname, bounds, section_tags, subsection_tags, other_tags, ids, name, denom_id, geom_id, timespan); ->>>>>>> New DO function _OBS_GetNumerators EXCEPTION WHEN OTHERS THEN GET STACKED DIAGNOSTICS _returned_sqlstate = RETURNED_SQLSTATE, _message_text = MESSAGE_TEXT, _pg_exception_context = PG_EXCEPTION_CONTEXT; RAISE WARNING USING ERRCODE = _returned_sqlstate, MESSAGE = _message_text, DETAIL = _pg_exception_context; -<<<<<<< HEAD RETURN ret; END; END; @@ -321,14 +298,10 @@ BEGIN _pg_exception_context = PG_EXCEPTION_CONTEXT; RAISE WARNING USING ERRCODE = _returned_sqlstate, MESSAGE = _message_text, DETAIL = _pg_exception_context; RETURN ret; -======= - ->>>>>>> New DO function _OBS_GetNumerators END; END; $$ LANGUAGE 'plpgsql' SECURITY DEFINER; -<<<<<<< HEAD CREATE OR REPLACE FUNCTION cdb_dataservices_client._cdb_geocode_postalcode_polygon (username text, orgname text, postal_code double precision, country_name text) RETURNS Geometry AS $$ CONNECT cdb_dataservices_client._server_conn_str(); diff --git a/client/cdb_dataservices_client--0.18.0--0.17.0.sql b/client/old_versions/cdb_dataservices_client--0.18.0--0.17.0.sql similarity index 100% rename from client/cdb_dataservices_client--0.18.0--0.17.0.sql rename to client/old_versions/cdb_dataservices_client--0.18.0--0.17.0.sql diff --git a/client/cdb_dataservices_client--0.18.0.sql b/client/old_versions/cdb_dataservices_client--0.18.0.sql similarity index 100% rename from client/cdb_dataservices_client--0.18.0.sql rename to client/old_versions/cdb_dataservices_client--0.18.0.sql diff --git a/server/extension/cdb_dataservices_server--0.25.0--0.26.0.sql b/server/extension/cdb_dataservices_server--0.25.0--0.26.0.sql new file mode 100644 index 0000000..b0d5812 --- /dev/null +++ b/server/extension/cdb_dataservices_server--0.25.0--0.26.0.sql @@ -0,0 +1,20 @@ +--DO NOT MODIFY THIS FILE, IT IS GENERATED AUTOMATICALLY FROM SOURCES +-- Complain if script is sourced in psql, rather than via CREATE EXTENSION +\echo Use "ALTER EXTENSION cdb_dataservices_server UPDATE TO '0.25.0'" to load this file. \quit + +CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetNumerators( + username TEXT, + orgname TEXT, + bounds geometry(Geometry, 4326) DEFAULT NULL, + section_tags TEXT[] DEFAULT ARRAY[]::TEXT[], + subsection_tags TEXT[] DEFAULT ARRAY[]::TEXT[], + other_tags TEXT[] DEFAULT ARRAY[]::TEXT[], + ids TEXT[] DEFAULT ARRAY[]::TEXT[], + name TEXT DEFAULT NULL, + denom_id TEXT DEFAULT '', + geom_id TEXT DEFAULT '', + timespan TEXT DEFAULT '') +RETURNS SETOF cdb_dataservices_server.obs_meta_numerator AS $$ + CONNECT cdb_dataservices_server._obs_server_conn_str(username, orgname); + SELECT * FROM cdb_observatory._OBS_GetNumerators(bounds, section_tags, subsection_tags, other_tags, ids, name, denom_id, geom_id, timespan); +$$ LANGUAGE plproxy; diff --git a/server/extension/cdb_dataservices_server--0.26.0--0.25.0.sql b/server/extension/cdb_dataservices_server--0.26.0--0.25.0.sql new file mode 100644 index 0000000..80fd533 --- /dev/null +++ b/server/extension/cdb_dataservices_server--0.26.0--0.25.0.sql @@ -0,0 +1,5 @@ +--DO NOT MODIFY THIS FILE, IT IS GENERATED AUTOMATICALLY FROM SOURCES +-- Complain if script is sourced in psql, rather than via CREATE EXTENSION +\echo Use "ALTER EXTENSION cdb_dataservices_server UPDATE TO '0.24.2'" to load this file. \quit + +DROP IF EXISTS FUNCTION cdb_dataservices_server._OBS_GetNumerators (text, text, geometry(Geometry, 4326), text[], text[] , text[], text[] , text, text, text,text); diff --git a/server/extension/cdb_dataservices_server.control b/server/extension/cdb_dataservices_server.control index 81bc98c..7549dfa 100644 --- a/server/extension/cdb_dataservices_server.control +++ b/server/extension/cdb_dataservices_server.control @@ -1,5 +1,5 @@ comment = 'CartoDB dataservices server extension' -default_version = '0.25.0' +default_version = '0.26.0' requires = 'plpythonu, plproxy, postgis, cdb_geocoder' superuser = true schema = cdb_dataservices_server diff --git a/server/extension/cdb_dataservices_server--0.24.2--0.25.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.24.2--0.25.0.sql similarity index 99% rename from server/extension/cdb_dataservices_server--0.24.2--0.25.0.sql rename to server/extension/old_versions/cdb_dataservices_server--0.24.2--0.25.0.sql index 840e3db..8cbbfb9 100644 --- a/server/extension/cdb_dataservices_server--0.24.2--0.25.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.24.2--0.25.0.sql @@ -21,3 +21,4 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygo RETURNS Geometry AS $$ SELECT cdb_dataservices_server.cdb_geocode_postalcode_polygon(username, orgname, code::text, country); $$ LANGUAGE SQL; + diff --git a/server/extension/cdb_dataservices_server--0.25.0--0.24.2.sql b/server/extension/old_versions/cdb_dataservices_server--0.25.0--0.24.2.sql similarity index 100% rename from server/extension/cdb_dataservices_server--0.25.0--0.24.2.sql rename to server/extension/old_versions/cdb_dataservices_server--0.25.0--0.24.2.sql diff --git a/server/extension/cdb_dataservices_server--0.25.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.25.0.sql similarity index 100% rename from server/extension/cdb_dataservices_server--0.25.0.sql rename to server/extension/old_versions/cdb_dataservices_server--0.25.0.sql