diff --git a/client/old_versions/cdb_dataservices_client--0.10.0--0.10.1.sql b/client/old_versions/cdb_dataservices_client--0.10.0--0.10.1.sql index 4209ee5..8e24d11 100644 --- a/client/old_versions/cdb_dataservices_client--0.10.0--0.10.1.sql +++ b/client/old_versions/cdb_dataservices_client--0.10.0--0.10.1.sql @@ -93,4 +93,4 @@ RETURNS boolean AS $$ .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), server_schema=plpy.quote_literal(server_schema), server_table_name=plpy.quote_literal(server_table_name), fdw_server=plpy.quote_literal(server_name)) ) return False -$$ LANGUAGE @@plpythonu@@; \ No newline at end of file +$$ LANGUAGE plpythonu; \ No newline at end of file diff --git a/client/old_versions/cdb_dataservices_client--0.10.0.sql b/client/old_versions/cdb_dataservices_client--0.10.0.sql index b3afeab..a1b8fff 100644 --- a/client/old_versions/cdb_dataservices_client--0.10.0.sql +++ b/client/old_versions/cdb_dataservices_client--0.10.0.sql @@ -1277,7 +1277,7 @@ RETURNS boolean AS $$ .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), server_schema=plpy.quote_literal(server_schema), server_table_name=plpy.quote_literal(server_table_name), fdw_server=plpy.quote_literal(server_name)) ) return False -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; @@ -1352,7 +1352,7 @@ RETURNS boolean AS $$ .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), server_schema=plpy.quote_literal(server_schema), server_table_name=plpy.quote_literal(server_table_name), fdw_server=plpy.quote_literal(server_name)) ) return False -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client._OBS_ConnectUserTable(username text, orgname text, user_db_role text, user_schema text, dbname text, table_name text) diff --git a/client/old_versions/cdb_dataservices_client--0.10.1--0.10.0.sql b/client/old_versions/cdb_dataservices_client--0.10.1--0.10.0.sql index 87168da..5aebf7c 100644 --- a/client/old_versions/cdb_dataservices_client--0.10.1--0.10.0.sql +++ b/client/old_versions/cdb_dataservices_client--0.10.1--0.10.0.sql @@ -88,4 +88,4 @@ RETURNS boolean AS $$ .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), server_schema=plpy.quote_literal(server_schema), server_table_name=plpy.quote_literal(server_table_name), fdw_server=plpy.quote_literal(server_name)) ) return False -$$ LANGUAGE @@plpythonu@@; \ No newline at end of file +$$ LANGUAGE plpythonu; \ No newline at end of file diff --git a/client/old_versions/cdb_dataservices_client--0.10.1.sql b/client/old_versions/cdb_dataservices_client--0.10.1.sql index 023722c..274ed68 100644 --- a/client/old_versions/cdb_dataservices_client--0.10.1.sql +++ b/client/old_versions/cdb_dataservices_client--0.10.1.sql @@ -1282,7 +1282,7 @@ RETURNS boolean AS $$ .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), server_schema=plpy.quote_literal(server_schema), server_table_name=plpy.quote_literal(server_table_name), fdw_server=plpy.quote_literal(server_name)) ) return False -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; @@ -1357,7 +1357,7 @@ RETURNS boolean AS $$ .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), server_schema=plpy.quote_literal(server_schema), server_table_name=plpy.quote_literal(server_table_name), fdw_server=plpy.quote_literal(server_name)) ) return False -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client._OBS_ConnectUserTable(username text, orgname text, user_db_role text, user_schema text, dbname text, table_name text) diff --git a/client/old_versions/cdb_dataservices_client--0.10.2--0.11.0.sql b/client/old_versions/cdb_dataservices_client--0.10.2--0.11.0.sql index 481bdd2..9d735a1 100644 --- a/client/old_versions/cdb_dataservices_client--0.10.2--0.11.0.sql +++ b/client/old_versions/cdb_dataservices_client--0.10.2--0.11.0.sql @@ -144,7 +144,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PrepareTableOBS_GetMeas ) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMeasure( username text, @@ -237,7 +237,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMea fdw_server=plpy.quote_literal(server_name))) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client._DST_ConnectUserTable( username text, diff --git a/client/old_versions/cdb_dataservices_client--0.10.2.sql b/client/old_versions/cdb_dataservices_client--0.10.2.sql index 2368198..f003137 100644 --- a/client/old_versions/cdb_dataservices_client--0.10.2.sql +++ b/client/old_versions/cdb_dataservices_client--0.10.2.sql @@ -1282,7 +1282,7 @@ RETURNS boolean AS $$ .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), server_schema=plpy.quote_literal(server_schema), server_table_name=plpy.quote_literal(server_table_name), fdw_server=plpy.quote_literal(server_name)) ) return False -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; @@ -1357,7 +1357,7 @@ RETURNS boolean AS $$ .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), server_schema=plpy.quote_literal(server_schema), server_table_name=plpy.quote_literal(server_table_name), fdw_server=plpy.quote_literal(server_name)) ) return False -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client._OBS_ConnectUserTable(username text, orgname text, user_db_role text, user_schema text, dbname text, table_name text) diff --git a/client/old_versions/cdb_dataservices_client--0.11.0--0.10.2.sql b/client/old_versions/cdb_dataservices_client--0.11.0--0.10.2.sql index 034a513..7bebfd9 100644 --- a/client/old_versions/cdb_dataservices_client--0.11.0--0.10.2.sql +++ b/client/old_versions/cdb_dataservices_client--0.11.0--0.10.2.sql @@ -175,7 +175,7 @@ RETURNS boolean AS $$ .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), server_schema=plpy.quote_literal(server_schema), server_table_name=plpy.quote_literal(server_table_name), fdw_server=plpy.quote_literal(server_name)) ) return False -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; @@ -250,7 +250,7 @@ RETURNS boolean AS $$ .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), server_schema=plpy.quote_literal(server_schema), server_table_name=plpy.quote_literal(server_table_name), fdw_server=plpy.quote_literal(server_name)) ) return False -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client._OBS_ConnectUserTable(username text, orgname text, user_db_role text, user_schema text, dbname text, table_name text) diff --git a/client/old_versions/cdb_dataservices_client--0.11.0--0.11.1.sql b/client/old_versions/cdb_dataservices_client--0.11.0--0.11.1.sql index a4cea79..0e60587 100644 --- a/client/old_versions/cdb_dataservices_client--0.11.0--0.11.1.sql +++ b/client/old_versions/cdb_dataservices_client--0.11.0--0.11.1.sql @@ -44,7 +44,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PrepareTableOBS_GetMeas ) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMeasure( username text, @@ -137,4 +137,4 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMea fdw_server=plpy.quote_literal(server_name))) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; diff --git a/client/old_versions/cdb_dataservices_client--0.11.0.sql b/client/old_versions/cdb_dataservices_client--0.11.0.sql index cf3aaaf..671069d 100644 --- a/client/old_versions/cdb_dataservices_client--0.11.0.sql +++ b/client/old_versions/cdb_dataservices_client--0.11.0.sql @@ -1251,7 +1251,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PrepareTableOBS_GetMeas ) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMeasure( username text, @@ -1344,7 +1344,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMea fdw_server=plpy.quote_literal(server_name))) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client._DST_ConnectUserTable( username text, diff --git a/client/old_versions/cdb_dataservices_client--0.11.1--0.11.0.sql b/client/old_versions/cdb_dataservices_client--0.11.1--0.11.0.sql index 294db98..d44d30c 100644 --- a/client/old_versions/cdb_dataservices_client--0.11.1--0.11.0.sql +++ b/client/old_versions/cdb_dataservices_client--0.11.1--0.11.0.sql @@ -44,7 +44,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PrepareTableOBS_GetMeas ) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMeasure( username text, @@ -137,4 +137,4 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMea fdw_server=plpy.quote_literal(server_name))) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; diff --git a/client/old_versions/cdb_dataservices_client--0.11.1.sql b/client/old_versions/cdb_dataservices_client--0.11.1.sql index c8092ac..05b6b34 100644 --- a/client/old_versions/cdb_dataservices_client--0.11.1.sql +++ b/client/old_versions/cdb_dataservices_client--0.11.1.sql @@ -1251,7 +1251,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PrepareTableOBS_GetMeas ) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMeasure( username text, @@ -1344,7 +1344,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMea fdw_server=plpy.quote_literal(server_name))) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client._DST_ConnectUserTable( username text, diff --git a/client/old_versions/cdb_dataservices_client--0.12.0.sql b/client/old_versions/cdb_dataservices_client--0.12.0.sql index 7ac7c5c..d0711cb 100644 --- a/client/old_versions/cdb_dataservices_client--0.12.0.sql +++ b/client/old_versions/cdb_dataservices_client--0.12.0.sql @@ -1396,7 +1396,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PrepareTableOBS_GetMeas ) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMeasure( username text, @@ -1489,7 +1489,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMea fdw_server=plpy.quote_literal(server_name))) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client._DST_ConnectUserTable( username text, diff --git a/client/old_versions/cdb_dataservices_client--0.12.1.sql b/client/old_versions/cdb_dataservices_client--0.12.1.sql index ca1cdd3..ee27ce0 100644 --- a/client/old_versions/cdb_dataservices_client--0.12.1.sql +++ b/client/old_versions/cdb_dataservices_client--0.12.1.sql @@ -1396,7 +1396,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PrepareTableOBS_GetMeas ) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMeasure( username text, @@ -1489,7 +1489,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMea fdw_server=plpy.quote_literal(server_name))) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client._DST_ConnectUserTable( username text, diff --git a/client/old_versions/cdb_dataservices_client--0.13.0.sql b/client/old_versions/cdb_dataservices_client--0.13.0.sql index 1ebb774..219bc19 100644 --- a/client/old_versions/cdb_dataservices_client--0.13.0.sql +++ b/client/old_versions/cdb_dataservices_client--0.13.0.sql @@ -1467,7 +1467,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PrepareTableOBS_GetMeas ) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMeasure( username text, @@ -1560,7 +1560,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMea fdw_server=plpy.quote_literal(server_name))) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client._DST_ConnectUserTable( username text, diff --git a/client/old_versions/cdb_dataservices_client--0.14.0.sql b/client/old_versions/cdb_dataservices_client--0.14.0.sql index 5cded17..682a4f1 100644 --- a/client/old_versions/cdb_dataservices_client--0.14.0.sql +++ b/client/old_versions/cdb_dataservices_client--0.14.0.sql @@ -1467,7 +1467,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PrepareTableOBS_GetMeas ) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMeasure( username text, @@ -1560,7 +1560,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMea fdw_server=plpy.quote_literal(server_name))) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client._DST_ConnectUserTable( username text, diff --git a/client/old_versions/cdb_dataservices_client--0.14.1.sql b/client/old_versions/cdb_dataservices_client--0.14.1.sql index 2f9ee84..df980e3 100644 --- a/client/old_versions/cdb_dataservices_client--0.14.1.sql +++ b/client/old_versions/cdb_dataservices_client--0.14.1.sql @@ -1470,7 +1470,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PrepareTableOBS_GetMeas ) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMeasure( username text, @@ -1563,7 +1563,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMea fdw_server=plpy.quote_literal(server_name))) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client._DST_ConnectUserTable( username text, diff --git a/client/old_versions/cdb_dataservices_client--0.15.0.sql b/client/old_versions/cdb_dataservices_client--0.15.0.sql index 0f9e647..66c3621 100644 --- a/client/old_versions/cdb_dataservices_client--0.15.0.sql +++ b/client/old_versions/cdb_dataservices_client--0.15.0.sql @@ -1551,7 +1551,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PrepareTableOBS_GetMeas ) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMeasure( username text, @@ -1644,7 +1644,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMea fdw_server=plpy.quote_literal(server_name))) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client._DST_ConnectUserTable( username text, diff --git a/client/old_versions/cdb_dataservices_client--0.16.0.sql b/client/old_versions/cdb_dataservices_client--0.16.0.sql index 40dfbbc..248c0cd 100644 --- a/client/old_versions/cdb_dataservices_client--0.16.0.sql +++ b/client/old_versions/cdb_dataservices_client--0.16.0.sql @@ -1550,7 +1550,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PrepareTableOBS_GetMeas ) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMeasure( username text, @@ -1643,7 +1643,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMea fdw_server=plpy.quote_literal(server_name))) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client._DST_ConnectUserTable( username text, diff --git a/client/old_versions/cdb_dataservices_client--0.17.0.sql b/client/old_versions/cdb_dataservices_client--0.17.0.sql index eb73a15..124aaef 100644 --- a/client/old_versions/cdb_dataservices_client--0.17.0.sql +++ b/client/old_versions/cdb_dataservices_client--0.17.0.sql @@ -1550,7 +1550,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PrepareTableOBS_GetMeas ) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMeasure( username text, @@ -1643,7 +1643,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMea fdw_server=plpy.quote_literal(server_name))) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client._DST_ConnectUserTable( username text, diff --git a/client/old_versions/cdb_dataservices_client--0.18.0.sql b/client/old_versions/cdb_dataservices_client--0.18.0.sql index 9b79ac8..a4a2574 100644 --- a/client/old_versions/cdb_dataservices_client--0.18.0.sql +++ b/client/old_versions/cdb_dataservices_client--0.18.0.sql @@ -1600,7 +1600,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PrepareTableOBS_GetMeas ) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMeasure( username text, @@ -1693,7 +1693,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMea fdw_server=plpy.quote_literal(server_name))) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client._DST_ConnectUserTable( username text, diff --git a/client/old_versions/cdb_dataservices_client--0.19.0.sql b/client/old_versions/cdb_dataservices_client--0.19.0.sql index 453b329..93865fe 100644 --- a/client/old_versions/cdb_dataservices_client--0.19.0.sql +++ b/client/old_versions/cdb_dataservices_client--0.19.0.sql @@ -1625,7 +1625,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PrepareTableOBS_GetMeas ) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMeasure( username text, @@ -1718,7 +1718,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMea fdw_server=plpy.quote_literal(server_name))) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client._DST_ConnectUserTable( username text, diff --git a/client/old_versions/cdb_dataservices_client--0.20.0.sql b/client/old_versions/cdb_dataservices_client--0.20.0.sql index 2b35cad..c968a53 100644 --- a/client/old_versions/cdb_dataservices_client--0.20.0.sql +++ b/client/old_versions/cdb_dataservices_client--0.20.0.sql @@ -1650,7 +1650,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PrepareTableOBS_GetMeas ) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMeasure( username text, @@ -1743,7 +1743,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMea fdw_server=plpy.quote_literal(server_name))) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client._DST_ConnectUserTable( username text, diff --git a/client/old_versions/cdb_dataservices_client--0.21.0--0.22.0.sql b/client/old_versions/cdb_dataservices_client--0.21.0--0.22.0.sql index 7042e4c..59af158 100644 --- a/client/old_versions/cdb_dataservices_client--0.21.0--0.22.0.sql +++ b/client/old_versions/cdb_dataservices_client--0.21.0--0.22.0.sql @@ -1612,7 +1612,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PrepareTableOBS_GetMeas ) return True -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMeasure( username text, @@ -1705,7 +1705,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMea fdw_server=plpy.quote_literal(server_name))) return True -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_client._DST_ConnectUserTable( username text, diff --git a/client/old_versions/cdb_dataservices_client--0.21.0.sql b/client/old_versions/cdb_dataservices_client--0.21.0.sql index 2d70aa3..b6bdb9f 100644 --- a/client/old_versions/cdb_dataservices_client--0.21.0.sql +++ b/client/old_versions/cdb_dataservices_client--0.21.0.sql @@ -1650,7 +1650,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PrepareTableOBS_GetMeas ) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMeasure( username text, @@ -1743,7 +1743,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMea fdw_server=plpy.quote_literal(server_name))) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client._DST_ConnectUserTable( username text, diff --git a/client/old_versions/cdb_dataservices_client--0.22.0--0.21.0.sql b/client/old_versions/cdb_dataservices_client--0.22.0--0.21.0.sql index 479bd19..51d5949 100644 --- a/client/old_versions/cdb_dataservices_client--0.22.0--0.21.0.sql +++ b/client/old_versions/cdb_dataservices_client--0.22.0--0.21.0.sql @@ -1610,7 +1610,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PrepareTableOBS_GetMeas ) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMeasure( username text, @@ -1703,7 +1703,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMea fdw_server=plpy.quote_literal(server_name))) return True -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client._DST_ConnectUserTable( username text, diff --git a/client/old_versions/cdb_dataservices_client--0.22.0.sql b/client/old_versions/cdb_dataservices_client--0.22.0.sql index 9306b2f..2c8bdf5 100644 --- a/client/old_versions/cdb_dataservices_client--0.22.0.sql +++ b/client/old_versions/cdb_dataservices_client--0.22.0.sql @@ -1652,7 +1652,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PrepareTableOBS_GetMeas ) return True -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMeasure( username text, @@ -1745,7 +1745,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMea fdw_server=plpy.quote_literal(server_name))) return True -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_client._DST_ConnectUserTable( username text, diff --git a/client/old_versions/cdb_dataservices_client--0.23.0.sql b/client/old_versions/cdb_dataservices_client--0.23.0.sql index 2c9b919..8732e8e 100644 --- a/client/old_versions/cdb_dataservices_client--0.23.0.sql +++ b/client/old_versions/cdb_dataservices_client--0.23.0.sql @@ -1727,7 +1727,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PrepareTableOBS_GetMeas ) return True -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMeasure( username text, @@ -1820,7 +1820,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMea fdw_server=plpy.quote_literal(server_name))) return True -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_client._DST_ConnectUserTable( username text, diff --git a/client/old_versions/cdb_dataservices_client--0.24.0.sql b/client/old_versions/cdb_dataservices_client--0.24.0.sql index abc6c6d..14a3af6 100644 --- a/client/old_versions/cdb_dataservices_client--0.24.0.sql +++ b/client/old_versions/cdb_dataservices_client--0.24.0.sql @@ -1802,7 +1802,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PrepareTableOBS_GetMeas ) return True -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMeasure( username text, @@ -1895,7 +1895,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMea fdw_server=plpy.quote_literal(server_name))) return True -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_client._DST_ConnectUserTable( username text, diff --git a/client/old_versions/cdb_dataservices_client--0.25.0.sql b/client/old_versions/cdb_dataservices_client--0.25.0.sql index f2a0f99..608684b 100644 --- a/client/old_versions/cdb_dataservices_client--0.25.0.sql +++ b/client/old_versions/cdb_dataservices_client--0.25.0.sql @@ -1886,7 +1886,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PrepareTableOBS_GetMeas ) return True -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMeasure( username text, @@ -1979,7 +1979,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMea fdw_server=plpy.quote_literal(server_name))) return True -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_client._DST_ConnectUserTable( username text, diff --git a/client/old_versions/cdb_dataservices_client--0.26.0.sql b/client/old_versions/cdb_dataservices_client--0.26.0.sql index 4c3d47c..f3f8201 100644 --- a/client/old_versions/cdb_dataservices_client--0.26.0.sql +++ b/client/old_versions/cdb_dataservices_client--0.26.0.sql @@ -2072,7 +2072,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PrepareTableOBS_GetMeas ) return True -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMeasure( username text, @@ -2165,7 +2165,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMea fdw_server=plpy.quote_literal(server_name))) return True -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_client._DST_ConnectUserTable( username text, diff --git a/client/old_versions/cdb_dataservices_client--0.26.1.sql b/client/old_versions/cdb_dataservices_client--0.26.1.sql index b1f649b..94b5fe7 100644 --- a/client/old_versions/cdb_dataservices_client--0.26.1.sql +++ b/client/old_versions/cdb_dataservices_client--0.26.1.sql @@ -2072,7 +2072,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PrepareTableOBS_GetMeas ) return True -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMeasure( username text, @@ -2165,7 +2165,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMea fdw_server=plpy.quote_literal(server_name))) return True -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_client._DST_ConnectUserTable( username text, diff --git a/client/old_versions/cdb_dataservices_client--0.26.2.sql b/client/old_versions/cdb_dataservices_client--0.26.2.sql index f04c481..4b387c7 100644 --- a/client/old_versions/cdb_dataservices_client--0.26.2.sql +++ b/client/old_versions/cdb_dataservices_client--0.26.2.sql @@ -2072,7 +2072,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PrepareTableOBS_GetMeas ) return True -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMeasure( username text, @@ -2165,7 +2165,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMea fdw_server=plpy.quote_literal(server_name))) return True -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_client._DST_ConnectUserTable( username text, diff --git a/client/old_versions/cdb_dataservices_client--0.27.0.sql b/client/old_versions/cdb_dataservices_client--0.27.0.sql index f671a36..e6f8feb 100644 --- a/client/old_versions/cdb_dataservices_client--0.27.0.sql +++ b/client/old_versions/cdb_dataservices_client--0.27.0.sql @@ -2143,7 +2143,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PrepareTableOBS_GetMeas ) return True -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMeasure( username text, @@ -2236,7 +2236,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMea fdw_server=plpy.quote_literal(server_name))) return True -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_client._DST_ConnectUserTable( username text, diff --git a/client/old_versions/cdb_dataservices_client--0.28.0.sql b/client/old_versions/cdb_dataservices_client--0.28.0.sql index 058a233..035f6c8 100644 --- a/client/old_versions/cdb_dataservices_client--0.28.0.sql +++ b/client/old_versions/cdb_dataservices_client--0.28.0.sql @@ -2172,7 +2172,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PrepareTableOBS_GetMeas ) return True -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMeasure( username text, @@ -2265,7 +2265,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_client.__DST_PopulateTableOBS_GetMea fdw_server=plpy.quote_literal(server_name))) return True -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_client._DST_ConnectUserTable( username text, diff --git a/client/old_versions/cdb_dataservices_client--0.9.0--0.10.0.sql b/client/old_versions/cdb_dataservices_client--0.9.0--0.10.0.sql index 94cc398..35b03d8 100644 --- a/client/old_versions/cdb_dataservices_client--0.9.0--0.10.0.sql +++ b/client/old_versions/cdb_dataservices_client--0.9.0--0.10.0.sql @@ -164,7 +164,7 @@ RETURNS boolean AS $$ .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), server_schema=plpy.quote_literal(server_schema), server_table_name=plpy.quote_literal(server_table_name), fdw_server=plpy.quote_literal(server_name)) ) return False -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; @@ -239,7 +239,7 @@ RETURNS boolean AS $$ .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), server_schema=plpy.quote_literal(server_schema), server_table_name=plpy.quote_literal(server_table_name), fdw_server=plpy.quote_literal(server_name)) ) return False -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_client._OBS_ConnectUserTable(username text, orgname text, user_db_role text, user_schema text, dbname text, table_name text) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.0.1--0.1.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.0.1--0.1.0.sql index 7dd9f95..272931d 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.0.1--0.1.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.0.1--0.1.0.sql @@ -46,7 +46,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the Redis configuration from the _conf table -- CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_geocoder_config(username text, orgname text) @@ -72,7 +72,7 @@ RETURNS boolean AS $$ # --for this user session but... GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country DROP FUNCTION IF EXISTS cdb_dataservices_server.cdb_geocode_street_point(TEXT, TEXT, TEXT, TEXT); diff --git a/server/extension/old_versions/cdb_dataservices_server--0.0.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.0.1.sql index 3e98d36..3bd145f 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.0.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.0.1.sql @@ -24,7 +24,7 @@ RETURNS cdb_dataservices_server._redis_conf_params AS $$ "timeout": params['timeout'], "redis_db": params['redis_db'] } -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; -- Get the connection to redis from cache or create a new one CREATE OR REPLACE FUNCTION cdb_dataservices_server._connect_to_redis(user_id text) @@ -43,7 +43,7 @@ RETURNS boolean AS $$ redis_db=config_params['redis_db']).redis_connection() GD[user_id] = {'redis_connection': redis_connection} return True -$$ LANGUAGE @@plpythonu@@;-- Geocodes a street address given a searchtext and a state and/or country +$$ LANGUAGE plpythonu;-- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -64,7 +64,7 @@ AS $$ point = plpy.execute(plan, [coordinates[0], coordinates[1]], 1)[0] return point['st_setsrid'] -$$ LANGUAGE @@plpythonu@@;-- Interface of the server extension +$$ LANGUAGE plpythonu;-- Interface of the server extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin0_polygon(username text, orgname text, country_name text) RETURNS Geometry AS $$ @@ -80,7 +80,7 @@ RETURNS Geometry AS $$ plpy.debug('Returning from Returning from cdb_geocode_admin0_polygons') return rv[0]["mypolygon"] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; -------------------------------------------------------------------------------- @@ -118,7 +118,7 @@ RETURNS Geometry AS $$ plpy.debug('Returning from Returning from cdb_geocode_admin1_polygons') return rv[0]["mypolygon"] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; ---- cdb_geocode_admin1_polygon(admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin1_polygon(username text, orgname text, admin1_name text, country_name text) @@ -135,7 +135,7 @@ RETURNS Geometry AS $$ plpy.debug('Returning from Returning from cdb_geocode_admin1_polygon(admin1_name text, country_name text)') return rv[0]["mypolygon"] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; -------------------------------------------------------------------------------- @@ -207,7 +207,7 @@ RETURNS Geometry AS $$ plpy.debug('Returning from Returning from geocode_namedplace') return rv[0]["mypoint"] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; ---- cdb_geocode_namedplace_point(city_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, country_name text) @@ -224,7 +224,7 @@ RETURNS Geometry AS $$ plpy.debug('Returning from Returning from geocode_namedplace') return rv[0]["mypoint"] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; ---- cdb_geocode_namedplace_point(city_name text, admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, admin1_name text, country_name text) @@ -241,7 +241,7 @@ RETURNS Geometry AS $$ plpy.debug('Returning from Returning from geocode_namedplace') return rv[0]["mypoint"] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; -------------------------------------------------------------------------------- @@ -327,7 +327,7 @@ RETURNS Geometry AS $$ plpy.debug('Returning from _cdb_geocode_postalcode_point') return rv[0]["point"] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code text, country text) RETURNS Geometry AS $$ @@ -343,7 +343,7 @@ RETURNS Geometry AS $$ plpy.debug('Returning from _cdb_geocode_postalcode_point') return rv[0]["point"] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code text) RETURNS Geometry AS $$ @@ -359,7 +359,7 @@ RETURNS Geometry AS $$ plpy.debug('Returning from _cdb_geocode_postalcode_polygon') return rv[0]["polygon"] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code text, country text) RETURNS Geometry AS $$ @@ -375,7 +375,7 @@ RETURNS Geometry AS $$ plpy.debug('Returning from _cdb_geocode_postalcode_point') return rv[0]["polygon"] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; -------------------------------------------------------------------------------- @@ -489,7 +489,7 @@ RETURNS Geometry AS $$ plpy.debug('Returning from _cdb_geocode_ipaddress_point') return rv[0]["point"] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; -------------------------------------------------------------------------------- diff --git a/server/extension/old_versions/cdb_dataservices_server--0.1.0--0.0.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.1.0--0.0.1.sql index 7755c0d..da200dd 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.1.0--0.0.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.1.0--0.0.1.sql @@ -26,4 +26,4 @@ AS $$ point = plpy.execute(plan, [coordinates[0], coordinates[1]], 1)[0] return point['st_setsrid'] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.1.0--0.2.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.1.0--0.2.0.sql index b2e71b7..a4f2997 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.1.0--0.2.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.1.0--0.2.0.sql @@ -22,7 +22,7 @@ RETURNS boolean AS $$ # --for this user session but... GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the connection to redis from cache or create a new one CREATE OR REPLACE FUNCTION cdb_dataservices_server._connect_to_redis(user_id text) @@ -53,7 +53,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ diff --git a/server/extension/old_versions/cdb_dataservices_server--0.1.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.1.0.sql index 0c173f7..c55335c 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.1.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.1.0.sql @@ -56,7 +56,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the Redis configuration from the _conf table -- CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -81,7 +81,7 @@ RETURNS boolean AS $$ # --for this user session but... GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ diff --git a/server/extension/old_versions/cdb_dataservices_server--0.10.0--0.11.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.10.0--0.11.0.sql index d5232b5..4ac7c63 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.10.0--0.11.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.10.0--0.11.0.sql @@ -98,4 +98,4 @@ RETURNS boolean AS $$ mapzen_geocoder_config = MapzenGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = mapzen_geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; \ No newline at end of file +$$ LANGUAGE plpythonu SECURITY DEFINER; \ No newline at end of file diff --git a/server/extension/old_versions/cdb_dataservices_server--0.10.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.10.0.sql index 1056fb3..9992b5c 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.10.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.10.0.sql @@ -63,7 +63,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -119,7 +119,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -1143,7 +1143,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1157,7 +1157,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1171,7 +1171,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1185,7 +1185,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1199,7 +1199,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1213,7 +1213,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2016,7 +2016,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username)) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.11.0--0.10.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.11.0--0.10.0.sql index c9d1fdf..0f67347 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.11.0--0.10.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.11.0--0.10.0.sql @@ -43,4 +43,4 @@ RETURNS Geometry AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; \ No newline at end of file +$$ LANGUAGE plpythonu; \ No newline at end of file diff --git a/server/extension/old_versions/cdb_dataservices_server--0.11.0--0.12.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.11.0--0.12.0.sql index 21702c1..d09ba67 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.11.0--0.12.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.11.0--0.12.0.sql @@ -71,7 +71,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ #plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; @@ -130,4 +130,4 @@ RETURNS boolean AS $$ mapzen_isolines_config = MapzenIsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = mapzen_isolines_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.11.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.11.0.sql index 4a1786a..f9937be 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.11.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.11.0.sql @@ -63,7 +63,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -119,7 +119,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -1143,7 +1143,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_mapzen_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1157,7 +1157,7 @@ RETURNS boolean AS $$ mapzen_geocoder_config = MapzenGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = mapzen_geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1171,7 +1171,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1185,7 +1185,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1199,7 +1199,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1213,7 +1213,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1227,7 +1227,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2074,7 +2074,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username)) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.12.0--0.13.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.12.0--0.13.0.sql index f096be6..ba7cf27 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.12.0--0.13.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.12.0--0.13.0.sql @@ -111,7 +111,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ #plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.12.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.12.0.sql index fac6151..b26ceef 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.12.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.12.0.sql @@ -63,7 +63,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -119,7 +119,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -1143,7 +1143,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_mapzen_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1157,7 +1157,7 @@ RETURNS boolean AS $$ mapzen_geocoder_config = MapzenGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = mapzen_geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_mapzen_isolines_config(username text, orgname text) RETURNS boolean AS $$ @@ -1171,7 +1171,7 @@ RETURNS boolean AS $$ mapzen_isolines_config = MapzenIsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = mapzen_isolines_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1185,7 +1185,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1199,7 +1199,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1213,7 +1213,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1227,7 +1227,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1241,7 +1241,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2088,7 +2088,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isolines( @@ -2159,7 +2159,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ #plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username)) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.13.0--0.12.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.13.0--0.12.0.sql index b31ab93..33bdc46 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.13.0--0.12.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.13.0--0.12.0.sql @@ -120,5 +120,5 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ #plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.13.0--0.13.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.13.0--0.13.1.sql index 773dd75..d36fdf2 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.13.0--0.13.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.13.0--0.13.1.sql @@ -11,7 +11,7 @@ RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ return plpy.execute("SELECT * FROM cdb_dataservices_server.__OBS_ConnectUserTable({username}::text, {orgname}::text, {user_db_role}::text, {schema}::text, {dbname}::text, {host_addr}::text, {table_name}::text)" .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), user_db_role=plpy.quote_literal(user_db_role), schema=plpy.quote_literal(input_schema), dbname=plpy.quote_literal(dbname), table_name=plpy.quote_literal(table_name), host_addr=plpy.quote_literal(host_addr)) )[0] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.__OBS_ConnectUserTable(username text, orgname text, user_db_role text, input_schema text, dbname text, host_addr text, table_name text) RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ diff --git a/server/extension/old_versions/cdb_dataservices_server--0.13.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.13.0.sql index 8a0b8a2..de79e50 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.13.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.13.0.sql @@ -63,7 +63,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -119,7 +119,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -1183,7 +1183,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_mapzen_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1197,7 +1197,7 @@ RETURNS boolean AS $$ mapzen_geocoder_config = MapzenGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = mapzen_geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_mapzen_isolines_config(username text, orgname text) RETURNS boolean AS $$ @@ -1211,7 +1211,7 @@ RETURNS boolean AS $$ mapzen_isolines_config = MapzenIsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = mapzen_isolines_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1225,7 +1225,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1239,7 +1239,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1253,7 +1253,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1267,7 +1267,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1281,7 +1281,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2128,7 +2128,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isolines( @@ -2202,7 +2202,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ #plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username)) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.13.1--0.13.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.13.1--0.13.0.sql index 3b7ae7b..5ab93ec 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.13.1--0.13.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.13.1--0.13.0.sql @@ -10,7 +10,7 @@ RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ return plpy.execute("SELECT * FROM cdb_dataservices_server.__OBS_ConnectUserTable({username}::text, {orgname}::text, {user_db_role}::text, {schema}::text, {dbname}::text, {table_name}::text)" .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), user_db_role=plpy.quote_literal(user_db_role), schema=plpy.quote_literal(input_schema), dbname=plpy.quote_literal(dbname), table_name=plpy.quote_literal(table_name)) )[0] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.__OBS_ConnectUserTable(username text, orgname text, user_db_role text, input_schema text, dbname text, table_name text) RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ diff --git a/server/extension/old_versions/cdb_dataservices_server--0.13.1--0.13.2.sql b/server/extension/old_versions/cdb_dataservices_server--0.13.1--0.13.2.sql index fa53d76..2c8a874 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.13.1--0.13.2.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.13.1--0.13.2.sql @@ -18,7 +18,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ @@ -34,4 +34,4 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ here_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_here_routing_isolines($1, $2, $3, $4, $5, $6, $7) as isoline; ", ["text", "text", "text", "geometry(Geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@; \ No newline at end of file +$$ LANGUAGE plpythonu; \ No newline at end of file diff --git a/server/extension/old_versions/cdb_dataservices_server--0.13.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.13.1.sql index f8af2b6..29ec164 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.13.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.13.1.sql @@ -63,7 +63,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -119,7 +119,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -1184,7 +1184,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_mapzen_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1198,7 +1198,7 @@ RETURNS boolean AS $$ mapzen_geocoder_config = MapzenGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = mapzen_geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_mapzen_isolines_config(username text, orgname text) RETURNS boolean AS $$ @@ -1212,7 +1212,7 @@ RETURNS boolean AS $$ mapzen_isolines_config = MapzenIsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = mapzen_isolines_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1226,7 +1226,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1240,7 +1240,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1254,7 +1254,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1268,7 +1268,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1282,7 +1282,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2129,7 +2129,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isolines( @@ -2203,7 +2203,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ #plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username)) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.13.2--0.13.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.13.2--0.13.1.sql index b45d9ab..6e45169 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.13.2--0.13.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.13.2--0.13.1.sql @@ -23,7 +23,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ isolines.append(isoline) return isolines -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ @@ -45,4 +45,4 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ isolines.append(isoline) return isolines -$$ LANGUAGE @@plpythonu@@; \ No newline at end of file +$$ LANGUAGE plpythonu; \ No newline at end of file diff --git a/server/extension/old_versions/cdb_dataservices_server--0.13.2--0.13.3.sql b/server/extension/old_versions/cdb_dataservices_server--0.13.2--0.13.3.sql index 999a98c..0d7fa1d 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.13.2--0.13.3.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.13.2--0.13.3.sql @@ -237,4 +237,4 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ #plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.13.2.sql b/server/extension/old_versions/cdb_dataservices_server--0.13.2.sql index 841c481..e1a6de7 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.13.2.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.13.2.sql @@ -63,7 +63,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -119,7 +119,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -1184,7 +1184,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_mapzen_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1198,7 +1198,7 @@ RETURNS boolean AS $$ mapzen_geocoder_config = MapzenGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = mapzen_geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_mapzen_isolines_config(username text, orgname text) RETURNS boolean AS $$ @@ -1212,7 +1212,7 @@ RETURNS boolean AS $$ mapzen_isolines_config = MapzenIsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = mapzen_isolines_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1226,7 +1226,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1240,7 +1240,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1254,7 +1254,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1268,7 +1268,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1282,7 +1282,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2129,7 +2129,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isolines( @@ -2203,7 +2203,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ #plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username)) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.13.3--0.13.2.sql b/server/extension/old_versions/cdb_dataservices_server--0.13.3--0.13.2.sql index f5faf47..ece562c 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.13.3--0.13.2.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.13.3--0.13.2.sql @@ -15,7 +15,7 @@ RETURNS boolean AS $$ mapzen_geocoder_config = MapzenGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = mapzen_geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_mapzen_isolines_config(username text, orgname text) RETURNS boolean AS $$ @@ -29,7 +29,7 @@ RETURNS boolean AS $$ mapzen_isolines_config = MapzenIsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = mapzen_isolines_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -220,4 +220,4 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ #plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.13.3--0.13.3.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.13.3--0.13.3.1.sql index 1d6441e..624f268 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.13.3--0.13.3.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.13.3--0.13.3.1.sql @@ -23,7 +23,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) else: plpy.error('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -46,4 +46,4 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) else: plpy.error('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.13.3.1--0.13.3.sql b/server/extension/old_versions/cdb_dataservices_server--0.13.3.1--0.13.3.sql index c47dabb..4e1060a 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.13.3.1--0.13.3.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.13.3.1--0.13.3.sql @@ -23,7 +23,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options], 1) else: plpy.error('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -46,4 +46,4 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options], 1) else: plpy.error('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.13.3.1--0.14.sql b/server/extension/old_versions/cdb_dataservices_server--0.13.3.1--0.14.sql index 4513c61..3dc6a05 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.13.3.1--0.14.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.13.3.1--0.14.sql @@ -13,7 +13,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) @@ -668,7 +668,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isolines( username TEXT, @@ -741,7 +741,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_route_with_waypoints( username TEXT, @@ -802,7 +802,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to get mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- DO diff --git a/server/extension/old_versions/cdb_dataservices_server--0.13.3.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.13.3.1.sql index ad628ea..904e09b 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.13.3.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.13.3.1.sql @@ -63,7 +63,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -119,7 +119,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -1184,7 +1184,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1198,7 +1198,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1212,7 +1212,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1226,7 +1226,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1240,7 +1240,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1254,7 +1254,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2104,7 +2104,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isolines( @@ -2178,7 +2178,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ #plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username)) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.13.3.sql b/server/extension/old_versions/cdb_dataservices_server--0.13.3.sql index d580a5f..5c847f6 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.13.3.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.13.3.sql @@ -63,7 +63,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -119,7 +119,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -1184,7 +1184,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1198,7 +1198,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1212,7 +1212,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1226,7 +1226,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1240,7 +1240,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1254,7 +1254,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2104,7 +2104,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isolines( @@ -2178,7 +2178,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ #plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username)) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.14--0.13.3.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.14--0.13.3.1.sql index 5738f40..5d3d87d 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.14--0.13.3.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.14--0.13.3.1.sql @@ -634,7 +634,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isolines( username TEXT, @@ -707,7 +707,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ #plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Routing @@ -767,7 +767,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- DO augmentation diff --git a/server/extension/old_versions/cdb_dataservices_server--0.14--0.14.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.14--0.14.1.sql index 4e1cd55..3b2dc05 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.14--0.14.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.14--0.14.1.sql @@ -62,4 +62,4 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; \ No newline at end of file +$$ LANGUAGE plpythonu SECURITY DEFINER; \ No newline at end of file diff --git a/server/extension/old_versions/cdb_dataservices_server--0.14.1--0.14.2.sql b/server/extension/old_versions/cdb_dataservices_server--0.14.1--0.14.2.sql index 575cb1b..3b3322f 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.14.1--0.14.2.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.14.1--0.14.2.sql @@ -56,7 +56,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusMeasure( username TEXT, @@ -111,7 +111,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetUSCensusMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPopulation( username TEXT, @@ -164,7 +164,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetPopulation') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByGeometry( username TEXT, @@ -222,7 +222,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByPointAndRadius( username TEXT, @@ -282,7 +282,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByGeometry( username TEXT, @@ -340,7 +340,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByPointAndRadius( username TEXT, @@ -400,4 +400,4 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; \ No newline at end of file +$$ LANGUAGE plpythonu; \ No newline at end of file diff --git a/server/extension/old_versions/cdb_dataservices_server--0.14.1--0.14.sql b/server/extension/old_versions/cdb_dataservices_server--0.14.1--0.14.sql index 1c91dc5..6a99f79 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.14.1--0.14.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.14.1--0.14.sql @@ -62,4 +62,4 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; \ No newline at end of file +$$ LANGUAGE plpythonu SECURITY DEFINER; \ No newline at end of file diff --git a/server/extension/old_versions/cdb_dataservices_server--0.14.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.14.1.sql index 5ebdfb5..c4470ef 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.14.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.14.1.sql @@ -66,7 +66,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -122,7 +122,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -1223,7 +1223,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1237,7 +1237,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1251,7 +1251,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1265,7 +1265,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1279,7 +1279,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1293,7 +1293,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1307,7 +1307,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2188,7 +2188,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isolines( @@ -2262,7 +2262,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username)) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.14.2--0.14.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.14.2--0.14.1.sql index c8a134f..2ae5e20 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.14.2--0.14.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.14.2--0.14.1.sql @@ -56,7 +56,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusMeasure( username TEXT, @@ -111,7 +111,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetUSCensusMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPopulation( username TEXT, @@ -164,7 +164,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetPopulation') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByGeometry( username TEXT, @@ -222,7 +222,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByPointAndRadius( username TEXT, @@ -282,7 +282,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByGeometry( username TEXT, @@ -340,7 +340,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByPointAndRadius( username TEXT, @@ -400,4 +400,4 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; \ No newline at end of file +$$ LANGUAGE plpythonu; \ No newline at end of file diff --git a/server/extension/old_versions/cdb_dataservices_server--0.14.2--0.15.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.14.2--0.15.0.sql index d432851..4061d63 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.14.2--0.15.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.14.2--0.15.0.sql @@ -17,7 +17,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; ---- cdb_geocode_namedplace_point(city_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.14.2.sql b/server/extension/old_versions/cdb_dataservices_server--0.14.2.sql index 8c37f2e..2972cd9 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.14.2.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.14.2.sql @@ -66,7 +66,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -122,7 +122,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -1223,7 +1223,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1237,7 +1237,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1251,7 +1251,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1265,7 +1265,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1279,7 +1279,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1293,7 +1293,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1307,7 +1307,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2188,7 +2188,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isolines( @@ -2262,7 +2262,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username)) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.14.sql b/server/extension/old_versions/cdb_dataservices_server--0.14.sql index d0d9d97..9d03454 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.14.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.14.sql @@ -66,7 +66,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -122,7 +122,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -1223,7 +1223,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1237,7 +1237,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1251,7 +1251,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1265,7 +1265,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1279,7 +1279,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1293,7 +1293,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1307,7 +1307,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2188,7 +2188,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isolines( @@ -2262,7 +2262,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username)) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.15.0--0.14.2.sql b/server/extension/old_versions/cdb_dataservices_server--0.15.0--0.14.2.sql index dd2edef..ced6499 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.15.0--0.14.2.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.15.0--0.14.2.sql @@ -19,7 +19,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text) RETURNS Geometry AS $$ diff --git a/server/extension/old_versions/cdb_dataservices_server--0.15.0--0.15.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.15.0--0.15.1.sql index b2d3be3..f111b30 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.15.0--0.15.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.15.0--0.15.1.sql @@ -16,7 +16,7 @@ RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ return plpy.execute("SELECT * FROM cdb_dataservices_server.__DST_ConnectUserTable({username}::text, {orgname}::text, {user_db_role}::text, {schema}::text, {dbname}::text, {host_addr}::text, {table_name}::text)" .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), user_db_role=plpy.quote_literal(user_db_role), schema=plpy.quote_literal(input_schema), dbname=plpy.quote_literal(dbname), table_name=plpy.quote_literal(table_name), host_addr=plpy.quote_literal(host_addr)) )[0] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.__DST_ConnectUserTable(username text, orgname text, user_db_role text, input_schema text, dbname text, host_addr text, table_name text) RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ diff --git a/server/extension/old_versions/cdb_dataservices_server--0.15.1--0.15.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.15.1--0.15.0.sql index 484483f..dc2a10f 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.15.1--0.15.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.15.1--0.15.0.sql @@ -16,7 +16,7 @@ RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ return plpy.execute("SELECT * FROM cdb_dataservices_server.__OBS_ConnectUserTable({username}::text, {orgname}::text, {user_db_role}::text, {schema}::text, {dbname}::text, {host_addr}::text, {table_name}::text)" .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), user_db_role=plpy.quote_literal(user_db_role), schema=plpy.quote_literal(input_schema), dbname=plpy.quote_literal(dbname), table_name=plpy.quote_literal(table_name), host_addr=plpy.quote_literal(host_addr)) )[0] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.__OBS_ConnectUserTable(username text, orgname text, user_db_role text, input_schema text, dbname text, host_addr text, table_name text) RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ diff --git a/server/extension/old_versions/cdb_dataservices_server--0.15.1--0.16.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.15.1--0.16.0.sql index f594b6c..c498615 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.15.1--0.16.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.15.1--0.16.0.sql @@ -66,4 +66,4 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapzen') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.15.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.15.1.sql index c416e90..5006a1e 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.15.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.15.1.sql @@ -66,7 +66,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -122,7 +122,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -1223,7 +1223,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_geocoder_config(username text, orgname text, provider text DEFAULT NULL) RETURNS boolean AS $$ @@ -1237,7 +1237,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1251,7 +1251,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1265,7 +1265,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1279,7 +1279,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1293,7 +1293,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1307,7 +1307,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2200,7 +2200,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isolines( @@ -2274,7 +2274,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username)) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.16.0--0.15.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.16.0--0.15.1.sql index af4068c..a9c041a 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.16.0--0.15.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.16.0--0.15.1.sql @@ -35,7 +35,7 @@ RETURNS Geometry AS $$ return plpy.execute(mapzen_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] else: raise Exception('Requested geocoder is not available') -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) @@ -51,4 +51,4 @@ RETURNS Geometry AS $$ else: raise Exception('Here geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.16.0--0.17.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.16.0--0.17.0.sql index 3a0eece..d4af955 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.16.0--0.17.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.16.0--0.17.0.sql @@ -28,7 +28,7 @@ RETURNS Geometry AS $$ else: raise Exception('Requested geocoder is not available') -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin0_polygon(username text, orgname text, country_name text) RETURNS Geometry AS $$ @@ -64,7 +64,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin0 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin1_polygon(username text, orgname text, admin1_name text) RETURNS Geometry AS $$ @@ -101,7 +101,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; ---- cdb_geocode_admin1_polygon(admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin1_polygon(username text, orgname text, admin1_name text, country_name text) @@ -139,7 +139,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_geocode_namedplace(username text, orgname text, city_name text, admin1_name text DEFAULT NULL, country_name text DEFAULT NULL) RETURNS Geometry AS $$ @@ -184,7 +184,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode city point using mapzen') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_internal_geocode_namedplace(username text, orgname text, city_name text, admin1_name text DEFAULT NULL, country_name text DEFAULT NULL) RETURNS Geometry AS $$ @@ -227,7 +227,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode namedplace point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code text) RETURNS Geometry AS $$ @@ -263,7 +263,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code text, country text) RETURNS Geometry AS $$ @@ -299,7 +299,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code text) RETURNS Geometry AS $$ @@ -335,7 +335,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code text, country text) RETURNS Geometry AS $$ @@ -371,7 +371,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_ipaddress_point(username text, orgname text, ip text) RETURNS Geometry AS $$ @@ -407,7 +407,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ @@ -434,7 +434,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, @@ -460,7 +460,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ mapzen_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapzen_route_with_waypoints($1, $2, $3, $4, $5, $6) as route;", ["text", "text", "geometry(Point, 4326)[]", "text", "text[]", "text"]) result = plpy.execute(mapzen_plan, [username, orgname, waypoints, mode, options, units]) return [result[0]['shape'],result[0]['length'], result[0]['duration']] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_with_waypoints( @@ -485,7 +485,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ mapzen_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapzen_route_with_waypoints($1, $2, $3, $4, $5, $6) as route;", ["text", "text", "geometry(Point, 4326)[]", "text", "text[]", "text"]) result = plpy.execute(mapzen_plan, [username, orgname, waypoints, mode, options, units]) return [result[0]['shape'],result[0]['length'], result[0]['duration']] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.obs_get_demographic_snapshot( username TEXT, @@ -528,7 +528,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetDemographicSnapshot( username TEXT, @@ -574,7 +574,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.obs_get_segment_snapshot( username TEXT, @@ -616,7 +616,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_segment_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetSegmentSnapshot( username TEXT, @@ -661,7 +661,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to OBS_GetSegmentSnapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetMeasure( username TEXT, @@ -705,7 +705,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetCategory( username TEXT, @@ -748,7 +748,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetUSCensusMeasure( username TEXT, @@ -792,7 +792,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetUSCensusMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetUSCensusCategory( username TEXT, @@ -835,7 +835,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetUSCensusCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetPopulation( username TEXT, @@ -878,7 +878,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetPopulation') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetMeasureById( username TEXT, @@ -921,7 +921,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_Search( username TEXT, @@ -970,7 +970,7 @@ RETURNS TABLE(id text, description text, name text, aggregate text, source text) raise Exception('Error trying to OBS_Search') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetAvailableBoundaries( username TEXT, @@ -1018,7 +1018,7 @@ RETURNS TABLE(boundary_id text, description text, time_span text, tablename text raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetBoundary( username TEXT, @@ -1060,7 +1060,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundary') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetBoundaryId( username TEXT, @@ -1102,7 +1102,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetBoundaryId') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetBoundaryById( username TEXT, @@ -1144,7 +1144,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundaryById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetBoundariesByGeometry( username TEXT, @@ -1192,7 +1192,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetBoundariesByPointAndRadius( username TEXT, @@ -1241,7 +1241,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetPointsByGeometry( username TEXT, @@ -1289,7 +1289,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetPointsByPointAndRadius( username TEXT, @@ -1338,4 +1338,4 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.16.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.16.0.sql index 4507a41..3bc37ad 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.16.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.16.0.sql @@ -66,7 +66,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -122,7 +122,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -1223,7 +1223,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1243,7 +1243,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1257,7 +1257,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1271,7 +1271,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1285,7 +1285,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1299,7 +1299,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1313,7 +1313,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2222,7 +2222,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isolines( @@ -2296,7 +2296,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username)) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.17.0--0.16.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.17.0--0.16.0.sql index a5cbc6e..3756c31 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.17.0--0.16.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.17.0--0.16.0.sql @@ -24,7 +24,7 @@ RETURNS Geometry AS $$ else: raise Exception('Requested geocoder is not available') -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin0_polygon(username text, orgname text, country_name text) RETURNS Geometry AS $$ from cartodb_services.metrics import QuotaService @@ -57,7 +57,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin0 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text) RETURNS Geometry AS $$ @@ -67,7 +67,7 @@ RETURNS Geometry AS $$ except BaseException as e: internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3) as point;", ["text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin1_polygon(username text, orgname text, admin1_name text) RETURNS Geometry AS $$ @@ -102,7 +102,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; ---- cdb_geocode_admin1_polygon(admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin1_polygon(username text, orgname text, admin1_name text, country_name text) @@ -138,7 +138,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; ---- cdb_geocode_namedplace_point(city_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, country_name text) @@ -149,7 +149,7 @@ RETURNS Geometry AS $$ except BaseException as e: internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, NULL, $4) as point;", ["text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; ---- cdb_geocode_namedplace_point(city_name text, admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, admin1_name text, country_name text) @@ -160,7 +160,7 @@ RETURNS Geometry AS $$ except BaseException as e: internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, $4, $5) as point;", ["text", "text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, admin1_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code text) RETURNS Geometry AS $$ @@ -194,7 +194,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code text, country text) RETURNS Geometry AS $$ @@ -228,7 +228,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code text) RETURNS Geometry AS $$ @@ -262,7 +262,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code text, country text) RETURNS Geometry AS $$ @@ -296,7 +296,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_ipaddress_point(username text, orgname text, ip text) RETURNS Geometry AS $$ @@ -330,7 +330,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ @@ -351,7 +351,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, @@ -371,7 +371,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ mapzen_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapzen_route_with_waypoints($1, $2, $3, $4, $5, $6) as route;", ["text", "text", "geometry(Point, 4326)[]", "text", "text[]", "text"]) result = plpy.execute(mapzen_plan, [username, orgname, waypoints, mode, options, units]) return [result[0]['shape'],result[0]['length'], result[0]['duration']] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_with_waypoints( @@ -390,7 +390,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ mapzen_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapzen_route_with_waypoints($1, $2, $3, $4, $5, $6) as route;", ["text", "text", "geometry(Point, 4326)[]", "text", "text[]", "text"]) result = plpy.execute(mapzen_plan, [username, orgname, waypoints, mode, options, units]) return [result[0]['shape'],result[0]['length'], result[0]['duration']] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.obs_get_demographic_snapshot( username TEXT, @@ -431,7 +431,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetDemographicSnapshot( username TEXT, @@ -475,7 +475,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.obs_get_segment_snapshot( username TEXT, @@ -515,7 +515,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_segment_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetSegmentSnapshot( username TEXT, @@ -558,7 +558,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to OBS_GetSegmentSnapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetMeasure( username TEXT, @@ -600,7 +600,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetCategory( username TEXT, @@ -641,7 +641,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetUSCensusMeasure( username TEXT, @@ -683,7 +683,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetUSCensusMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetUSCensusCategory( username TEXT, @@ -724,7 +724,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetUSCensusCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetPopulation( username TEXT, @@ -765,7 +765,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetPopulation') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetMeasureById( username TEXT, @@ -806,7 +806,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_Search( username TEXT, @@ -853,7 +853,7 @@ RETURNS TABLE(id text, description text, name text, aggregate text, source text) raise Exception('Error trying to OBS_Search') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetAvailableBoundaries( username TEXT, @@ -899,7 +899,7 @@ RETURNS TABLE(boundary_id text, description text, time_span text, tablename text raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetBoundary( username TEXT, @@ -939,7 +939,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundary') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetBoundaryId( username TEXT, @@ -979,7 +979,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetBoundaryId') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetBoundaryById( username TEXT, @@ -1019,7 +1019,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundaryById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetBoundariesByGeometry( username TEXT, @@ -1065,7 +1065,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetBoundariesByPointAndRadius( username TEXT, @@ -1112,7 +1112,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetPointsByGeometry( username TEXT, @@ -1158,7 +1158,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetPointsByPointAndRadius( username TEXT, @@ -1205,4 +1205,4 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.17.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.17.0.sql index 2afe550..7c060bc 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.17.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.17.0.sql @@ -66,7 +66,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -132,7 +132,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -1271,7 +1271,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1291,7 +1291,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1305,7 +1305,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1319,7 +1319,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1333,7 +1333,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1347,7 +1347,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1361,7 +1361,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2296,7 +2296,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isolines( @@ -2370,7 +2370,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username)) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.18.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.18.0.sql index 047fa57..2cfea6a 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.18.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.18.0.sql @@ -66,7 +66,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -134,7 +134,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -1343,7 +1343,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1363,7 +1363,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1377,7 +1377,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1391,7 +1391,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1405,7 +1405,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1419,7 +1419,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1433,7 +1433,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2368,7 +2368,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isolines( @@ -2442,7 +2442,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username)) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.18.1--0.19.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.18.1--0.19.0.sql index 4dc06fe..b86858c 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.18.1--0.19.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.18.1--0.19.0.sql @@ -89,7 +89,7 @@ RETURNS SETOF cdb_dataservices_server.service_quota_info AS $$ ret += [[service, monthly_quota, used_quota, soft_limit, provider]] return ret -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_enough_quota( diff --git a/server/extension/old_versions/cdb_dataservices_server--0.18.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.18.1.sql index a1de4cb..5fb2e20 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.18.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.18.1.sql @@ -66,7 +66,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -134,7 +134,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -1343,7 +1343,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1363,7 +1363,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1377,7 +1377,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1391,7 +1391,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1405,7 +1405,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1419,7 +1419,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1433,7 +1433,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2368,7 +2368,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isolines( @@ -2442,7 +2442,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username)) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.19.0--0.20.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.19.0--0.20.0.sql index b5cf55c..9290e24 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.19.0--0.20.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.19.0--0.20.0.sql @@ -68,7 +68,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isochrones( @@ -132,7 +132,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ diff --git a/server/extension/old_versions/cdb_dataservices_server--0.19.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.19.0.sql index 50c38f5..b3bb470 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.19.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.19.0.sql @@ -66,7 +66,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -134,7 +134,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -1343,7 +1343,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1363,7 +1363,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1377,7 +1377,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1391,7 +1391,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1405,7 +1405,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1419,7 +1419,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1433,7 +1433,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'service_type') THEN @@ -2473,7 +2473,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isolines( @@ -2547,7 +2547,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username)) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.2.0--0.1.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.2.0--0.1.0.sql index 045e0b0..d2a3ad3 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.2.0--0.1.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.2.0--0.1.0.sql @@ -22,7 +22,7 @@ RETURNS boolean AS $$ # --for this user session but... GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the connection to redis from cache or create a new one CREATE OR REPLACE FUNCTION cdb_dataservices_server._connect_to_redis(user_id text) @@ -53,7 +53,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ diff --git a/server/extension/old_versions/cdb_dataservices_server--0.2.0--0.3.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.2.0--0.3.0.sql index 64cda9d..ce17bc0 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.2.0--0.3.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.2.0--0.3.0.sql @@ -27,7 +27,7 @@ RETURNS Geometry AS $$ plpy.error(error_msg) finally: quota_service.increment_total_geocoder_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin1_polygon(username text, orgname text, admin1_name text) RETURNS Geometry AS $$ @@ -58,7 +58,7 @@ RETURNS Geometry AS $$ plpy.error(error_msg) finally: quota_service.increment_total_geocoder_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin1_polygon(username text, orgname text, admin1_name text, country_name text) RETURNS Geometry AS $$ @@ -89,7 +89,7 @@ RETURNS Geometry AS $$ plpy.error(error_msg) finally: quota_service.increment_total_geocoder_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text) RETURNS Geometry AS $$ @@ -120,7 +120,7 @@ RETURNS Geometry AS $$ plpy.error(error_msg) finally: quota_service.increment_total_geocoder_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, country_name text) RETURNS Geometry AS $$ @@ -151,7 +151,7 @@ RETURNS Geometry AS $$ plpy.error(error_msg) finally: quota_service.increment_total_geocoder_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, admin1_name text, country_name text) RETURNS Geometry AS $$ @@ -182,7 +182,7 @@ RETURNS Geometry AS $$ plpy.error(error_msg) finally: quota_service.increment_total_geocoder_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code text) RETURNS Geometry AS $$ @@ -213,7 +213,7 @@ RETURNS Geometry AS $$ plpy.error(error_msg) finally: quota_service.increment_total_geocoder_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code text, country text) RETURNS Geometry AS $$ @@ -244,7 +244,7 @@ RETURNS Geometry AS $$ plpy.error(error_msg) finally: quota_service.increment_total_geocoder_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code text) RETURNS Geometry AS $$ @@ -275,7 +275,7 @@ RETURNS Geometry AS $$ plpy.error(error_msg) finally: quota_service.increment_total_geocoder_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code text, country text) RETURNS Geometry AS $$ @@ -306,7 +306,7 @@ RETURNS Geometry AS $$ plpy.error(error_msg) finally: quota_service.increment_total_geocoder_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_ipaddress_point(username text, orgname text, ip text) RETURNS Geometry AS $$ @@ -337,4 +337,4 @@ RETURNS Geometry AS $$ plpy.error(error_msg) finally: quota_service.increment_total_geocoder_use() -$$ LANGUAGE @@plpythonu@@; \ No newline at end of file +$$ LANGUAGE plpythonu; \ No newline at end of file diff --git a/server/extension/old_versions/cdb_dataservices_server--0.2.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.2.0.sql index bf05af2..9c66887 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.2.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.2.0.sql @@ -57,7 +57,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the Redis configuration from the _conf table -- CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -82,7 +82,7 @@ RETURNS boolean AS $$ # --for this user session but... GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ diff --git a/server/extension/old_versions/cdb_dataservices_server--0.20.0--0.19.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.20.0--0.19.0.sql index 0e2c8dd..eba02e6 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.20.0--0.19.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.20.0--0.19.0.sql @@ -70,7 +70,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.20.0--0.21.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.20.0--0.21.0.sql index 3914dfa..7f286b9 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.20.0--0.21.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.20.0--0.21.0.sql @@ -62,7 +62,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomvals)) -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -123,7 +123,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomrefs)) -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeta( username TEXT, @@ -171,4 +171,4 @@ RETURNS JSON AS $$ import sys logger.error('Error trying to OBS_GetMeta', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_GetMeta') -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.20.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.20.0.sql index f101bbb..0bf4bcc 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.20.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.20.0.sql @@ -66,7 +66,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -134,7 +134,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -1343,7 +1343,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1363,7 +1363,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1377,7 +1377,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1391,7 +1391,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1405,7 +1405,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1419,7 +1419,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1433,7 +1433,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'service_type') THEN @@ -2473,7 +2473,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isodistance( username TEXT, @@ -2539,7 +2539,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isochrones( @@ -2603,7 +2603,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics diff --git a/server/extension/old_versions/cdb_dataservices_server--0.21.0--0.22.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.21.0--0.22.0.sql index d97ce2c..b441abb 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.21.0--0.22.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.21.0--0.22.0.sql @@ -62,7 +62,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) @@ -225,7 +225,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isochrones( @@ -289,4 +289,4 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.21.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.21.0.sql index 4657310..3e714d1 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.21.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.21.0.sql @@ -66,7 +66,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -134,7 +134,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -1513,7 +1513,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1533,7 +1533,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1547,7 +1547,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1561,7 +1561,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1575,7 +1575,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1589,7 +1589,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1603,7 +1603,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'service_type') THEN @@ -2643,7 +2643,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isodistance( username TEXT, @@ -2709,7 +2709,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isochrones( @@ -2773,7 +2773,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics diff --git a/server/extension/old_versions/cdb_dataservices_server--0.22.0--0.21.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.22.0--0.21.0.sql index 433e692..849690a 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.22.0--0.21.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.22.0--0.21.0.sql @@ -62,7 +62,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) @@ -225,7 +225,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isochrones( @@ -289,4 +289,4 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.22.0--0.23.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.22.0--0.23.0.sql index ebe32dc..0e22abf 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.22.0--0.23.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.22.0--0.23.0.sql @@ -19,7 +19,7 @@ RETURNS JSON AS $$ return json.dumps({'limit': rate_limit_config.limit, 'period': rate_limit_config.period}) else: return None -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_user_rate_limit( username TEXT, @@ -43,7 +43,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_user_rate_limits(config) -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_org_rate_limit( username TEXT, @@ -67,7 +67,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_org_rate_limits(config) -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_server_rate_limit( username TEXT, @@ -91,7 +91,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_server_rate_limits(config) -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.CDB_Conf_SetConf(key text, value JSON) @@ -137,7 +137,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using here maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -166,7 +166,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using google maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -204,4 +204,4 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapzen') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.22.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.22.0.sql index 53ac78e..77255d0 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.22.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.22.0.sql @@ -66,7 +66,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -134,7 +134,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -1513,7 +1513,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1533,7 +1533,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1547,7 +1547,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1561,7 +1561,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1575,7 +1575,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1589,7 +1589,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1603,7 +1603,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'service_type') THEN @@ -2643,7 +2643,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isodistance( username TEXT, @@ -2709,7 +2709,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isochrones( @@ -2773,7 +2773,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics diff --git a/server/extension/old_versions/cdb_dataservices_server--0.23.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.23.0.sql index 7deb1c6..713ad58 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.23.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.23.0.sql @@ -66,7 +66,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -134,7 +134,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -1513,7 +1513,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1551,7 +1551,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1565,7 +1565,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1579,7 +1579,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1593,7 +1593,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1607,7 +1607,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1621,7 +1621,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'service_type') THEN @@ -2720,7 +2720,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isodistance( username TEXT, @@ -2786,7 +2786,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isochrones( @@ -2850,7 +2850,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics diff --git a/server/extension/old_versions/cdb_dataservices_server--0.24.0--0.24.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.24.0--0.24.1.sql index a7a2856..78fb9d3 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.24.0--0.24.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.24.0--0.24.1.sql @@ -48,7 +48,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomvals)) -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetData( @@ -97,4 +97,4 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomrefs)) -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.24.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.24.0.sql index 57484c9..182922f 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.24.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.24.0.sql @@ -66,7 +66,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -134,7 +134,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -1513,7 +1513,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1551,7 +1551,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1565,7 +1565,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1579,7 +1579,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1593,7 +1593,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1607,7 +1607,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1621,7 +1621,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'service_type') THEN @@ -2720,7 +2720,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isodistance( username TEXT, @@ -2786,7 +2786,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isochrones( @@ -2850,7 +2850,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics diff --git a/server/extension/old_versions/cdb_dataservices_server--0.24.1--0.24.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.24.1--0.24.0.sql index 507c126..1e0c396 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.24.1--0.24.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.24.1--0.24.0.sql @@ -48,7 +48,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomvals)) -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetData( @@ -97,4 +97,4 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomrefs)) -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.24.1--0.24.2.sql b/server/extension/old_versions/cdb_dataservices_server--0.24.1--0.24.2.sql index 0ac9424..a1015d3 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.24.1--0.24.2.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.24.1--0.24.2.sql @@ -13,7 +13,7 @@ RETURNS Geometry AS $$ except spiexceptions.ExternalRoutineException as e: internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3) as point;", ["text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; ---- cdb_geocode_namedplace_point(city_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, country_name text) @@ -25,7 +25,7 @@ RETURNS Geometry AS $$ except spiexceptions.ExternalRoutineException as e: internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, NULL, $4) as point;", ["text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; ---- cdb_geocode_namedplace_point(city_name text, admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, admin1_name text, country_name text) @@ -37,4 +37,4 @@ RETURNS Geometry AS $$ except spiexceptions.ExternalRoutineException as e: internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, $4, $5) as point;", ["text", "text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, admin1_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.24.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.24.1.sql index 5c11d24..a529f4e 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.24.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.24.1.sql @@ -66,7 +66,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -134,7 +134,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -1513,7 +1513,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1551,7 +1551,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1565,7 +1565,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1579,7 +1579,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1593,7 +1593,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1607,7 +1607,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1621,7 +1621,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'service_type') THEN @@ -2720,7 +2720,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isodistance( username TEXT, @@ -2786,7 +2786,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isochrones( @@ -2850,7 +2850,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics diff --git a/server/extension/old_versions/cdb_dataservices_server--0.24.2--0.24.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.24.2--0.24.1.sql index b13ef14..4b53c5f 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.24.2--0.24.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.24.2--0.24.1.sql @@ -11,7 +11,7 @@ RETURNS Geometry AS $$ except BaseException as e: internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3) as point;", ["text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; ---- cdb_geocode_namedplace_point(city_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, country_name text) @@ -22,7 +22,7 @@ RETURNS Geometry AS $$ except BaseException as e: internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, NULL, $4) as point;", ["text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; ---- cdb_geocode_namedplace_point(city_name text, admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, admin1_name text, country_name text) @@ -33,4 +33,4 @@ RETURNS Geometry AS $$ except BaseException as e: internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, $4, $5) as point;", ["text", "text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, admin1_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.24.2.sql b/server/extension/old_versions/cdb_dataservices_server--0.24.2.sql index 2f2420f..b8257f7 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.24.2.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.24.2.sql @@ -66,7 +66,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -134,7 +134,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -1513,7 +1513,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1551,7 +1551,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1565,7 +1565,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1579,7 +1579,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1593,7 +1593,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1607,7 +1607,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1621,7 +1621,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'service_type') THEN @@ -2723,7 +2723,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isodistance( username TEXT, @@ -2789,7 +2789,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isochrones( @@ -2853,7 +2853,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics diff --git a/server/extension/old_versions/cdb_dataservices_server--0.25.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.25.0.sql index 9cc17d7..c6c7ed0 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.25.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.25.0.sql @@ -66,7 +66,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -134,7 +134,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -1513,7 +1513,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1551,7 +1551,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1565,7 +1565,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1579,7 +1579,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1593,7 +1593,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1607,7 +1607,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1621,7 +1621,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'service_type') THEN @@ -2747,7 +2747,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isodistance( username TEXT, @@ -2813,7 +2813,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isochrones( @@ -2877,7 +2877,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics diff --git a/server/extension/old_versions/cdb_dataservices_server--0.26.0--0.27.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.26.0--0.27.0.sql index 9fbc247..0747fd3 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.26.0--0.27.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.26.0--0.27.0.sql @@ -47,4 +47,4 @@ RETURNS TABLE(valid boolean, errors text[]) AS $$ import sys logger.error('Error trying to OBS_MetadataValidation', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_MetadataValidation') -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.26.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.26.0.sql index 12bc9d7..4a878ad 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.26.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.26.0.sql @@ -66,7 +66,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -134,7 +134,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -1530,7 +1530,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1568,7 +1568,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1582,7 +1582,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1596,7 +1596,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1610,7 +1610,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1624,7 +1624,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1638,7 +1638,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'service_type') THEN @@ -2764,7 +2764,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isodistance( username TEXT, @@ -2830,7 +2830,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isochrones( @@ -2894,7 +2894,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics diff --git a/server/extension/old_versions/cdb_dataservices_server--0.27.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.27.0.sql index 3962f70..bc715df 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.27.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.27.0.sql @@ -66,7 +66,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -134,7 +134,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -1576,7 +1576,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1614,7 +1614,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1628,7 +1628,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1642,7 +1642,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1656,7 +1656,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1670,7 +1670,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1684,7 +1684,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'service_type') THEN @@ -2810,7 +2810,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isodistance( username TEXT, @@ -2876,7 +2876,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isochrones( @@ -2940,7 +2940,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics diff --git a/server/extension/old_versions/cdb_dataservices_server--0.28.0--0.29.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.28.0--0.29.0.sql index d872a35..e32af4d 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.28.0--0.29.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.28.0--0.29.0.sql @@ -61,7 +61,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -86,7 +86,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ mapzen_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapzen_route_with_waypoints($1, $2, $3, $4, $5, $6) as route;", ["text", "text", "geometry(Point, 4326)[]", "text", "text[]", "text"]) result = plpy.execute(mapzen_plan, [username, orgname, waypoints, mode, options, units]) return [result[0]['shape'],result[0]['length'], result[0]['duration']] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_with_waypoints( @@ -111,7 +111,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ mapzen_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapzen_route_with_waypoints($1, $2, $3, $4, $5, $6) as route;", ["text", "text", "geometry(Point, 4326)[]", "text", "text[]", "text"]) result = plpy.execute(mapzen_plan, [username, orgname, waypoints, mode, options, units]) return [result[0]['shape'],result[0]['length'], result[0]['duration']] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- Get the connection to redis from cache or create a new one CREATE OR REPLACE FUNCTION cdb_dataservices_server._connect_to_redis(user_id text) RETURNS boolean AS $$ @@ -129,7 +129,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- -- Observatory connection config -- @@ -146,7 +146,7 @@ RETURNS text AS $$ user_obs_config = GD["user_obs_snapshot_config_{0}".format(username)] return user_obs_config.connection_str -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshotJSON( username TEXT, @@ -200,7 +200,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshot( username TEXT, @@ -257,7 +257,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshotJSON( username TEXT, @@ -309,7 +309,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_segment_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshot( username TEXT, @@ -364,7 +364,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to OBS_GetSegmentSnapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasure( username TEXT, @@ -421,7 +421,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetCategory( username TEXT, @@ -476,7 +476,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusMeasure( username TEXT, @@ -533,7 +533,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetUSCensusMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusCategory( username TEXT, @@ -588,7 +588,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetUSCensusCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPopulation( username TEXT, @@ -643,7 +643,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetPopulation') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasureById( username TEXT, @@ -698,7 +698,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -759,7 +759,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomvals)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -820,7 +820,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomrefs)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeta( username TEXT, @@ -868,7 +868,7 @@ RETURNS JSON AS $$ import sys logger.error('Error trying to OBS_GetMeta', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_GetMeta') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_MetadataValidation( username TEXT, @@ -914,7 +914,7 @@ RETURNS TABLE(valid boolean, errors text[]) AS $$ import sys logger.error('Error trying to OBS_MetadataValidation', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_MetadataValidation') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_Search( username TEXT, orgname TEXT, @@ -972,7 +972,7 @@ RETURNS TABLE(id text, description text, name text, aggregate text, source text) raise Exception('Error trying to OBS_Search') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetAvailableBoundaries( username TEXT, @@ -1030,7 +1030,7 @@ RETURNS TABLE(boundary_id text, description text, time_span text, tablename text raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundary( username TEXT, orgname TEXT, @@ -1082,7 +1082,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundary') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryId( username TEXT, @@ -1135,7 +1135,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetBoundaryId') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryById( username TEXT, @@ -1188,7 +1188,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundaryById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByGeometry( username TEXT, @@ -1248,7 +1248,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByPointAndRadius( username TEXT, @@ -1310,7 +1310,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByGeometry( username TEXT, @@ -1370,7 +1370,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByPointAndRadius( username TEXT, @@ -1432,7 +1432,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._DST_ConnectUserTable(username text, orgname text, user_db_role text, input_schema text, dbname text, table_name text) RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ @@ -1440,7 +1440,7 @@ RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ return plpy.execute("SELECT * FROM cdb_dataservices_server.__DST_ConnectUserTable({username}::text, {orgname}::text, {user_db_role}::text, {schema}::text, {dbname}::text, {host_addr}::text, {table_name}::text)" .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), user_db_role=plpy.quote_literal(user_db_role), schema=plpy.quote_literal(input_schema), dbname=plpy.quote_literal(dbname), table_name=plpy.quote_literal(table_name), host_addr=plpy.quote_literal(host_addr)) )[0] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.__DST_ConnectUserTable(username text, orgname text, user_db_role text, input_schema text, dbname text, host_addr text, table_name text) RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ @@ -1563,7 +1563,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1601,7 +1601,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1615,7 +1615,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1629,7 +1629,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1643,7 +1643,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1657,7 +1657,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1671,7 +1671,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_quota_info( username TEXT, @@ -1735,7 +1735,7 @@ RETURNS SETOF cdb_dataservices_server.service_quota_info AS $$ ret += [[service, monthly_quota, used_quota, soft_limit, provider]] return ret -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_enough_quota( @@ -1779,7 +1779,7 @@ RETURNS Geometry AS $$ else: raise Exception('Requested geocoder is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) @@ -1795,7 +1795,7 @@ RETURNS Geometry AS $$ else: raise Exception('Here geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1810,7 +1810,7 @@ RETURNS Geometry AS $$ else: raise Exception('Google geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1823,7 +1823,7 @@ RETURNS Geometry AS $$ mapzen_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapzen_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapzen_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1852,7 +1852,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using here maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1881,7 +1881,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using google maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1919,7 +1919,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapzen') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_get_rate_limit( username TEXT, @@ -1938,7 +1938,7 @@ RETURNS JSON AS $$ return json.dumps({'limit': rate_limit_config.limit, 'period': rate_limit_config.period}) else: return None -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_user_rate_limit( username TEXT, @@ -1962,7 +1962,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_user_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_org_rate_limit( username TEXT, @@ -1986,7 +1986,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_org_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_server_rate_limit( username TEXT, @@ -2010,7 +2010,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_server_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin0_polygon(username text, orgname text, country_name text) RETURNS Geometry AS $$ from cartodb_services.metrics import QuotaService @@ -2045,7 +2045,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin0 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2102,7 +2102,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_admin1_polygon(admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin1_polygon(username text, orgname text, admin1_name text, country_name text) @@ -2140,7 +2140,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2205,7 +2205,7 @@ RETURNS Geometry AS $$ except spiexceptions.ExternalRoutineException as e: internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3) as point;", ["text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, country_name text) @@ -2217,7 +2217,7 @@ RETURNS Geometry AS $$ except spiexceptions.ExternalRoutineException as e: internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, NULL, $4) as point;", ["text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, admin1_name text, country_name text) @@ -2229,7 +2229,7 @@ RETURNS Geometry AS $$ except spiexceptions.ExternalRoutineException as e: internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, $4, $5) as point;", ["text", "text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, admin1_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_geocode_namedplace(username text, orgname text, city_name text, admin1_name text DEFAULT NULL, country_name text DEFAULT NULL) RETURNS Geometry AS $$ @@ -2274,7 +2274,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode city point using mapzen') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_internal_geocode_namedplace(username text, orgname text, city_name text, admin1_name text DEFAULT NULL, country_name text DEFAULT NULL) RETURNS Geometry AS $$ @@ -2317,7 +2317,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode namedplace point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2421,7 +2421,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -2463,7 +2463,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -2505,7 +2505,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -2548,7 +2548,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -2684,7 +2684,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2772,7 +2772,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isodistance( username TEXT, @@ -2838,7 +2838,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isochrones( @@ -2902,7 +2902,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -2928,7 +2928,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -2943,7 +2943,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -2957,7 +2957,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -2983,7 +2983,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -2998,7 +2998,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3011,4 +3011,4 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapzen_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapzen_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.28.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.28.0.sql index d5ee6cc..588ad8e 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.28.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.28.0.sql @@ -66,7 +66,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -134,7 +134,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -1577,7 +1577,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1615,7 +1615,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1629,7 +1629,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1643,7 +1643,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1657,7 +1657,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1671,7 +1671,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1685,7 +1685,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'service_type') THEN @@ -2811,7 +2811,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isodistance( username TEXT, @@ -2877,7 +2877,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isochrones( @@ -2941,7 +2941,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics diff --git a/server/extension/old_versions/cdb_dataservices_server--0.29.0--0.28.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.29.0--0.28.0.sql index f6f9096..18e7b9c 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.29.0--0.28.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.29.0--0.28.0.sql @@ -64,7 +64,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -132,7 +132,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -1567,7 +1567,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1605,7 +1605,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1619,7 +1619,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1633,7 +1633,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1647,7 +1647,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1661,7 +1661,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1675,7 +1675,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_quota_info( @@ -2777,7 +2777,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isodistance( username TEXT, @@ -2843,7 +2843,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isochrones( @@ -2907,7 +2907,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics diff --git a/server/extension/old_versions/cdb_dataservices_server--0.29.0--0.30.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.29.0--0.30.0.sql index b8f88a7..0fc7486 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.29.0--0.30.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.29.0--0.30.0.sql @@ -62,7 +62,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate Mapbox routing') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, @@ -97,7 +97,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_with_waypoints( username TEXT, @@ -129,7 +129,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -159,7 +159,7 @@ RETURNS Geometry AS $$ else: raise Exception('Requested geocoder is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -172,7 +172,7 @@ RETURNS Geometry AS $$ mapzen_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapbox_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapzen_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -210,7 +210,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapzen') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -250,7 +250,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapbox') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text) @@ -270,7 +270,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3) as point;", ["text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, country_name text) @@ -290,7 +290,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, NULL, $4) as point;", ["text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, admin1_name text, country_name text) @@ -310,7 +310,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, $4, $5) as point;", ["text", "text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, admin1_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isodistance( username TEXT, @@ -375,7 +375,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isochrones( username TEXT, @@ -436,7 +436,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ @@ -466,7 +466,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapbox isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -480,7 +480,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ @@ -510,7 +510,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapbox isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -523,7 +523,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapbox_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapbox_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetData( username TEXT, @@ -570,7 +570,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomvals)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetData( username TEXT, @@ -618,7 +618,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomrefs)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetMeta( username TEXT, @@ -653,4 +653,4 @@ RETURNS JSON AS $$ import sys logger.error('Error trying to OBS_GetMeta', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_GetMeta') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.29.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.29.0.sql index 7ecb9d3..045f23b 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.29.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.29.0.sql @@ -66,7 +66,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -91,7 +91,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ mapzen_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapzen_route_with_waypoints($1, $2, $3, $4, $5, $6) as route;", ["text", "text", "geometry(Point, 4326)[]", "text", "text[]", "text"]) result = plpy.execute(mapzen_plan, [username, orgname, waypoints, mode, options, units]) return [result[0]['shape'],result[0]['length'], result[0]['duration']] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_with_waypoints( @@ -116,7 +116,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ mapzen_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapzen_route_with_waypoints($1, $2, $3, $4, $5, $6) as route;", ["text", "text", "geometry(Point, 4326)[]", "text", "text[]", "text"]) result = plpy.execute(mapzen_plan, [username, orgname, waypoints, mode, options, units]) return [result[0]['shape'],result[0]['length'], result[0]['duration']] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- Get the connection to redis from cache or create a new one CREATE OR REPLACE FUNCTION cdb_dataservices_server._connect_to_redis(user_id text) RETURNS boolean AS $$ @@ -134,7 +134,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- -- Observatory connection config -- @@ -151,7 +151,7 @@ RETURNS text AS $$ user_obs_config = GD["user_obs_snapshot_config_{0}".format(username)] return user_obs_config.connection_str -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshotJSON( username TEXT, @@ -205,7 +205,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshot( username TEXT, @@ -262,7 +262,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshotJSON( username TEXT, @@ -314,7 +314,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_segment_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshot( username TEXT, @@ -369,7 +369,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to OBS_GetSegmentSnapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasure( username TEXT, @@ -426,7 +426,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetCategory( username TEXT, @@ -481,7 +481,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusMeasure( username TEXT, @@ -538,7 +538,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetUSCensusMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusCategory( username TEXT, @@ -593,7 +593,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetUSCensusCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPopulation( username TEXT, @@ -648,7 +648,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetPopulation') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasureById( username TEXT, @@ -703,7 +703,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -764,7 +764,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomvals)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -825,7 +825,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomrefs)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeta( username TEXT, @@ -873,7 +873,7 @@ RETURNS JSON AS $$ import sys logger.error('Error trying to OBS_GetMeta', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_GetMeta') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_MetadataValidation( username TEXT, @@ -919,7 +919,7 @@ RETURNS TABLE(valid boolean, errors text[]) AS $$ import sys logger.error('Error trying to OBS_MetadataValidation', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_MetadataValidation') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_Search( username TEXT, orgname TEXT, @@ -977,7 +977,7 @@ RETURNS TABLE(id text, description text, name text, aggregate text, source text) raise Exception('Error trying to OBS_Search') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetAvailableBoundaries( username TEXT, @@ -1035,7 +1035,7 @@ RETURNS TABLE(boundary_id text, description text, time_span text, tablename text raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundary( username TEXT, orgname TEXT, @@ -1087,7 +1087,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundary') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryId( username TEXT, @@ -1140,7 +1140,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetBoundaryId') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryById( username TEXT, @@ -1193,7 +1193,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundaryById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByGeometry( username TEXT, @@ -1253,7 +1253,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByPointAndRadius( username TEXT, @@ -1315,7 +1315,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByGeometry( username TEXT, @@ -1375,7 +1375,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByPointAndRadius( username TEXT, @@ -1437,7 +1437,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE TYPE cdb_dataservices_server.ds_fdw_metadata as (schemaname text, tabname text, servername text); CREATE TYPE cdb_dataservices_server.ds_return_metadata as (colnames text[], coltypes text[]); @@ -1448,7 +1448,7 @@ RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ return plpy.execute("SELECT * FROM cdb_dataservices_server.__DST_ConnectUserTable({username}::text, {orgname}::text, {user_db_role}::text, {schema}::text, {dbname}::text, {host_addr}::text, {table_name}::text)" .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), user_db_role=plpy.quote_literal(user_db_role), schema=plpy.quote_literal(input_schema), dbname=plpy.quote_literal(dbname), table_name=plpy.quote_literal(table_name), host_addr=plpy.quote_literal(host_addr)) )[0] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.__DST_ConnectUserTable(username text, orgname text, user_db_role text, input_schema text, dbname text, host_addr text, table_name text) RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ @@ -1577,7 +1577,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1615,7 +1615,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1629,7 +1629,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1643,7 +1643,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1657,7 +1657,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1671,7 +1671,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1685,7 +1685,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'service_type') THEN @@ -1773,7 +1773,7 @@ RETURNS SETOF cdb_dataservices_server.service_quota_info AS $$ ret += [[service, monthly_quota, used_quota, soft_limit, provider]] return ret -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_enough_quota( @@ -1817,7 +1817,7 @@ RETURNS Geometry AS $$ else: raise Exception('Requested geocoder is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) @@ -1833,7 +1833,7 @@ RETURNS Geometry AS $$ else: raise Exception('Here geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1848,7 +1848,7 @@ RETURNS Geometry AS $$ else: raise Exception('Google geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1861,7 +1861,7 @@ RETURNS Geometry AS $$ mapzen_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapzen_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapzen_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1890,7 +1890,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using here maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1919,7 +1919,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using google maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1957,7 +1957,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapzen') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_get_rate_limit( username TEXT, @@ -1976,7 +1976,7 @@ RETURNS JSON AS $$ return json.dumps({'limit': rate_limit_config.limit, 'period': rate_limit_config.period}) else: return None -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_user_rate_limit( username TEXT, @@ -2000,7 +2000,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_user_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_org_rate_limit( username TEXT, @@ -2024,7 +2024,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_org_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_server_rate_limit( username TEXT, @@ -2048,7 +2048,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_server_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin0_polygon(username text, orgname text, country_name text) RETURNS Geometry AS $$ from cartodb_services.metrics import QuotaService @@ -2083,7 +2083,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin0 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2140,7 +2140,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_admin1_polygon(admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin1_polygon(username text, orgname text, admin1_name text, country_name text) @@ -2178,7 +2178,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2243,7 +2243,7 @@ RETURNS Geometry AS $$ except spiexceptions.ExternalRoutineException as e: internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3) as point;", ["text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, country_name text) @@ -2255,7 +2255,7 @@ RETURNS Geometry AS $$ except spiexceptions.ExternalRoutineException as e: internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, NULL, $4) as point;", ["text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, admin1_name text, country_name text) @@ -2267,7 +2267,7 @@ RETURNS Geometry AS $$ except spiexceptions.ExternalRoutineException as e: internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, $4, $5) as point;", ["text", "text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, admin1_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_geocode_namedplace(username text, orgname text, city_name text, admin1_name text DEFAULT NULL, country_name text DEFAULT NULL) RETURNS Geometry AS $$ @@ -2312,7 +2312,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode city point using mapzen') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_internal_geocode_namedplace(username text, orgname text, city_name text, admin1_name text DEFAULT NULL, country_name text DEFAULT NULL) RETURNS Geometry AS $$ @@ -2355,7 +2355,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode namedplace point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2459,7 +2459,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -2501,7 +2501,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -2543,7 +2543,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -2586,7 +2586,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -2722,7 +2722,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2811,7 +2811,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isodistance( username TEXT, @@ -2877,7 +2877,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isochrones( @@ -2941,7 +2941,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -2967,7 +2967,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -2982,7 +2982,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -2996,7 +2996,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -3022,7 +3022,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3037,7 +3037,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3050,7 +3050,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapzen_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapzen_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; DO $$ BEGIN IF NOT EXISTS ( diff --git a/server/extension/old_versions/cdb_dataservices_server--0.3.0--0.2.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.3.0--0.2.0.sql index c993785..c6b8268 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.3.0--0.2.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.3.0--0.2.0.sql @@ -12,7 +12,7 @@ RETURNS Geometry AS $$ plpy.debug('Returning from Returning from cdb_geocode_admin0_polygons') return rv[0]["mypolygon"] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin1_polygon(username text, orgname text, admin1_name text) RETURNS Geometry AS $$ @@ -28,7 +28,7 @@ RETURNS Geometry AS $$ plpy.debug('Returning from Returning from cdb_geocode_admin1_polygons') return rv[0]["mypolygon"] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin1_polygon(username text, orgname text, admin1_name text, country_name text) RETURNS Geometry AS $$ @@ -44,7 +44,7 @@ RETURNS Geometry AS $$ plpy.debug('Returning from Returning from cdb_geocode_admin1_polygon(admin1_name text, country_name text)') return rv[0]["mypolygon"] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text) RETURNS Geometry AS $$ @@ -60,7 +60,7 @@ RETURNS Geometry AS $$ plpy.debug('Returning from Returning from geocode_namedplace') return rv[0]["mypoint"] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, country_name text) RETURNS Geometry AS $$ @@ -76,7 +76,7 @@ RETURNS Geometry AS $$ plpy.debug('Returning from Returning from geocode_namedplace') return rv[0]["mypoint"] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, admin1_name text, country_name text) RETURNS Geometry AS $$ @@ -92,7 +92,7 @@ RETURNS Geometry AS $$ plpy.debug('Returning from Returning from geocode_namedplace') return rv[0]["mypoint"] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code text) RETURNS Geometry AS $$ @@ -108,7 +108,7 @@ RETURNS Geometry AS $$ plpy.debug('Returning from _cdb_geocode_postalcode_point') return rv[0]["point"] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code text, country text) RETURNS Geometry AS $$ @@ -124,7 +124,7 @@ RETURNS Geometry AS $$ plpy.debug('Returning from _cdb_geocode_postalcode_point') return rv[0]["point"] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code text) RETURNS Geometry AS $$ @@ -140,7 +140,7 @@ RETURNS Geometry AS $$ plpy.debug('Returning from _cdb_geocode_postalcode_polygon') return rv[0]["polygon"] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code text, country text) RETURNS Geometry AS $$ @@ -156,7 +156,7 @@ RETURNS Geometry AS $$ plpy.debug('Returning from _cdb_geocode_postalcode_point') return rv[0]["polygon"] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_ipaddress_point(username text, orgname text, ip text) RETURNS Geometry AS $$ @@ -172,4 +172,4 @@ RETURNS Geometry AS $$ plpy.debug('Returning from _cdb_geocode_ipaddress_point') return rv[0]["point"] -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.3.0--0.4.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.3.0--0.4.0.sql index facff74..d56be82 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.3.0--0.4.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.3.0--0.4.0.sql @@ -22,7 +22,7 @@ RETURNS boolean AS $$ # --for this user session but... GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE TYPE cdb_dataservices_server.isoline AS (center geometry(Geometry,4326), data_range integer, the_geom geometry(Multipolygon,4326)); @@ -77,7 +77,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.error(error_msg) finally: quota_service.increment_total_geocoder_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ diff --git a/server/extension/old_versions/cdb_dataservices_server--0.3.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.3.0.sql index ce02822..c34e8a4 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.3.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.3.0.sql @@ -57,7 +57,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the Redis configuration from the _conf table -- CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -82,7 +82,7 @@ RETURNS boolean AS $$ # --for this user session but... GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ diff --git a/server/extension/old_versions/cdb_dataservices_server--0.30.0--0.29.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.30.0--0.29.0.sql index 944d270..acabd05 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.30.0--0.29.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.30.0--0.29.0.sql @@ -29,7 +29,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ mapzen_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapzen_route_with_waypoints($1, $2, $3, $4, $5, $6) as route;", ["text", "text", "geometry(Point, 4326)[]", "text", "text[]", "text"]) result = plpy.execute(mapzen_plan, [username, orgname, waypoints, mode, options, units]) return [result[0]['shape'],result[0]['length'], result[0]['duration']] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_with_waypoints( username TEXT, @@ -53,7 +53,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ mapzen_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapzen_route_with_waypoints($1, $2, $3, $4, $5, $6) as route;", ["text", "text", "geometry(Point, 4326)[]", "text", "text[]", "text"]) result = plpy.execute(mapzen_plan, [username, orgname, waypoints, mode, options, units]) return [result[0]['shape'],result[0]['length'], result[0]['duration']] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -80,7 +80,7 @@ RETURNS Geometry AS $$ else: raise Exception('Requested geocoder is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; DROP FUNCTION IF EXISTS cdb_dataservices_server.cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT, state_province TEXT, country TEXT); @@ -120,7 +120,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapzen') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; DROP FUNCTION IF EXISTS cdb_dataservices_server._cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT, state_province TEXT, country TEXT); @@ -134,7 +134,7 @@ RETURNS Geometry AS $$ except spiexceptions.ExternalRoutineException as e: internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3) as point;", ["text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, country_name text) @@ -146,7 +146,7 @@ RETURNS Geometry AS $$ except spiexceptions.ExternalRoutineException as e: internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, NULL, $4) as point;", ["text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, admin1_name text, country_name text) @@ -158,7 +158,7 @@ RETURNS Geometry AS $$ except spiexceptions.ExternalRoutineException as e: internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, $4, $5) as point;", ["text", "text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, admin1_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; DROP FUNCTION IF EXISTS cdb_dataservices_server._cdb_mapbox_geocode_namedplace(username text, orgname text, city_name text, admin1_name text, country_name text); @@ -205,7 +205,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode city point using mapzen') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; DROP FUNCTION IF EXISTS cdb_dataservices_server._cdb_mapbox_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, data_range integer[], options text[]); @@ -236,7 +236,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; DROP FUNCTION IF EXISTS cdb_dataservices_server.cdb_mapbox_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[]); @@ -265,7 +265,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; DROP FUNCTION IF EXISTS cdb_dataservices_server.cdb_mapbox_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[]); @@ -314,7 +314,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomvals)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetData( username TEXT, @@ -362,7 +362,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomrefs)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetMeta( username TEXT, @@ -397,4 +397,4 @@ RETURNS JSON AS $$ import sys logger.error('Error trying to OBS_GetMeta', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_GetMeta') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.30.0--0.30.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.30.0--0.30.1.sql index f10bedf..072c847 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.30.0--0.30.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.30.0--0.30.1.sql @@ -44,4 +44,4 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapbox') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.30.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.30.0.sql index 88703f8..02ceec5 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.30.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.30.0.sql @@ -66,7 +66,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate Mapbox routing') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_route_with_waypoints( username TEXT, @@ -127,7 +127,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -161,7 +161,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_with_waypoints( @@ -194,7 +194,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- Get the connection to redis from cache or create a new one CREATE OR REPLACE FUNCTION cdb_dataservices_server._connect_to_redis(user_id text) RETURNS boolean AS $$ @@ -212,7 +212,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- -- Observatory connection config -- @@ -229,7 +229,7 @@ RETURNS text AS $$ user_obs_config = GD["user_obs_snapshot_config_{0}".format(username)] return user_obs_config.connection_str -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshotJSON( username TEXT, @@ -283,7 +283,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshot( username TEXT, @@ -340,7 +340,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshotJSON( username TEXT, @@ -392,7 +392,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_segment_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshot( username TEXT, @@ -447,7 +447,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to OBS_GetSegmentSnapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasure( username TEXT, @@ -504,7 +504,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetCategory( username TEXT, @@ -559,7 +559,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusMeasure( username TEXT, @@ -616,7 +616,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetUSCensusMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusCategory( username TEXT, @@ -671,7 +671,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetUSCensusCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPopulation( username TEXT, @@ -726,7 +726,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetPopulation') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasureById( username TEXT, @@ -781,7 +781,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -842,7 +842,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomvals)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -903,7 +903,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomrefs)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeta( username TEXT, @@ -951,7 +951,7 @@ RETURNS JSON AS $$ import sys logger.error('Error trying to OBS_GetMeta', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_GetMeta') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_MetadataValidation( username TEXT, @@ -997,7 +997,7 @@ RETURNS TABLE(valid boolean, errors text[]) AS $$ import sys logger.error('Error trying to OBS_MetadataValidation', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_MetadataValidation') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_Search( username TEXT, orgname TEXT, @@ -1055,7 +1055,7 @@ RETURNS TABLE(id text, description text, name text, aggregate text, source text) raise Exception('Error trying to OBS_Search') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetAvailableBoundaries( username TEXT, @@ -1113,7 +1113,7 @@ RETURNS TABLE(boundary_id text, description text, time_span text, tablename text raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundary( username TEXT, orgname TEXT, @@ -1165,7 +1165,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundary') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryId( username TEXT, @@ -1218,7 +1218,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetBoundaryId') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryById( username TEXT, @@ -1271,7 +1271,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundaryById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByGeometry( username TEXT, @@ -1331,7 +1331,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByPointAndRadius( username TEXT, @@ -1393,7 +1393,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByGeometry( username TEXT, @@ -1453,7 +1453,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByPointAndRadius( username TEXT, @@ -1515,7 +1515,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE TYPE cdb_dataservices_server.ds_fdw_metadata as (schemaname text, tabname text, servername text); CREATE TYPE cdb_dataservices_server.ds_return_metadata as (colnames text[], coltypes text[]); @@ -1526,7 +1526,7 @@ RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ return plpy.execute("SELECT * FROM cdb_dataservices_server.__DST_ConnectUserTable({username}::text, {orgname}::text, {user_db_role}::text, {schema}::text, {dbname}::text, {host_addr}::text, {table_name}::text)" .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), user_db_role=plpy.quote_literal(user_db_role), schema=plpy.quote_literal(input_schema), dbname=plpy.quote_literal(dbname), table_name=plpy.quote_literal(table_name), host_addr=plpy.quote_literal(host_addr)) )[0] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.__DST_ConnectUserTable(username text, orgname text, user_db_role text, input_schema text, dbname text, host_addr text, table_name text) RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ @@ -1655,7 +1655,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1693,7 +1693,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1707,7 +1707,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1721,7 +1721,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1735,7 +1735,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1749,7 +1749,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1763,7 +1763,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_type inner join pg_namespace ON (pg_type.typnamespace = pg_namespace.oid) @@ -1855,7 +1855,7 @@ RETURNS SETOF cdb_dataservices_server.service_quota_info AS $$ ret += [[service, monthly_quota, used_quota, soft_limit, provider]] return ret -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_enough_quota( @@ -1903,7 +1903,7 @@ RETURNS Geometry AS $$ else: raise Exception('Requested geocoder is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) @@ -1919,7 +1919,7 @@ RETURNS Geometry AS $$ else: raise Exception('Here geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1934,7 +1934,7 @@ RETURNS Geometry AS $$ else: raise Exception('Google geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1947,7 +1947,7 @@ RETURNS Geometry AS $$ mapzen_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapzen_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapzen_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1960,7 +1960,7 @@ RETURNS Geometry AS $$ mapzen_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapbox_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapzen_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1989,7 +1989,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using here maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2018,7 +2018,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using google maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2056,7 +2056,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapzen') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2096,7 +2096,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapbox') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_get_rate_limit( username TEXT, @@ -2115,7 +2115,7 @@ RETURNS JSON AS $$ return json.dumps({'limit': rate_limit_config.limit, 'period': rate_limit_config.period}) else: return None -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_user_rate_limit( username TEXT, @@ -2139,7 +2139,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_user_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_org_rate_limit( username TEXT, @@ -2163,7 +2163,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_org_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_server_rate_limit( username TEXT, @@ -2187,7 +2187,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_server_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin0_polygon(username text, orgname text, country_name text) RETURNS Geometry AS $$ from cartodb_services.metrics import QuotaService @@ -2222,7 +2222,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin0 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2279,7 +2279,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_admin1_polygon(admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin1_polygon(username text, orgname text, admin1_name text, country_name text) @@ -2317,7 +2317,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2390,7 +2390,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3) as point;", ["text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, country_name text) @@ -2410,7 +2410,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, NULL, $4) as point;", ["text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, admin1_name text, country_name text) @@ -2430,7 +2430,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, $4, $5) as point;", ["text", "text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, admin1_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_internal_geocode_namedplace(username text, orgname text, city_name text, admin1_name text DEFAULT NULL, country_name text DEFAULT NULL) RETURNS Geometry AS $$ @@ -2473,7 +2473,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode namedplace point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2577,7 +2577,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -2619,7 +2619,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -2661,7 +2661,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -2704,7 +2704,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -2840,7 +2840,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2929,7 +2929,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isodistance( username TEXT, @@ -2995,7 +2995,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isodistance( username TEXT, @@ -3060,7 +3060,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isochrones( username TEXT, @@ -3123,7 +3123,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isochrones( username TEXT, @@ -3184,7 +3184,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -3213,7 +3213,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3228,7 +3228,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3242,7 +3242,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapbox isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3256,7 +3256,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -3285,7 +3285,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3300,7 +3300,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3313,7 +3313,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapzen_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapzen_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapbox isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3326,7 +3326,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapbox_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapbox_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; DO $$ BEGIN IF NOT EXISTS ( diff --git a/server/extension/old_versions/cdb_dataservices_server--0.30.1--0.30.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.30.1--0.30.0.sql index 11f6142..434c7f0 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.30.1--0.30.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.30.1--0.30.0.sql @@ -41,4 +41,4 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapbox') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.30.1--0.30.2.sql b/server/extension/old_versions/cdb_dataservices_server--0.30.1--0.30.2.sql index 2c3eda3..07be2bd 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.30.1--0.30.2.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.30.1--0.30.2.sql @@ -34,7 +34,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using here maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -66,7 +66,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using google maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -107,7 +107,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapzen') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -153,4 +153,4 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapbox') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.30.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.30.1.sql index bb57745..ae00156 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.30.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.30.1.sql @@ -66,7 +66,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate Mapbox routing') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_route_with_waypoints( username TEXT, @@ -127,7 +127,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -161,7 +161,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_with_waypoints( @@ -194,7 +194,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- Get the connection to redis from cache or create a new one CREATE OR REPLACE FUNCTION cdb_dataservices_server._connect_to_redis(user_id text) RETURNS boolean AS $$ @@ -212,7 +212,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- -- Observatory connection config -- @@ -229,7 +229,7 @@ RETURNS text AS $$ user_obs_config = GD["user_obs_snapshot_config_{0}".format(username)] return user_obs_config.connection_str -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshotJSON( username TEXT, @@ -283,7 +283,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshot( username TEXT, @@ -340,7 +340,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshotJSON( username TEXT, @@ -392,7 +392,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_segment_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshot( username TEXT, @@ -447,7 +447,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to OBS_GetSegmentSnapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasure( username TEXT, @@ -504,7 +504,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetCategory( username TEXT, @@ -559,7 +559,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusMeasure( username TEXT, @@ -616,7 +616,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetUSCensusMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusCategory( username TEXT, @@ -671,7 +671,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetUSCensusCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPopulation( username TEXT, @@ -726,7 +726,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetPopulation') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasureById( username TEXT, @@ -781,7 +781,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -842,7 +842,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomvals)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -903,7 +903,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomrefs)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeta( username TEXT, @@ -951,7 +951,7 @@ RETURNS JSON AS $$ import sys logger.error('Error trying to OBS_GetMeta', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_GetMeta') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_MetadataValidation( username TEXT, @@ -997,7 +997,7 @@ RETURNS TABLE(valid boolean, errors text[]) AS $$ import sys logger.error('Error trying to OBS_MetadataValidation', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_MetadataValidation') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_Search( username TEXT, orgname TEXT, @@ -1055,7 +1055,7 @@ RETURNS TABLE(id text, description text, name text, aggregate text, source text) raise Exception('Error trying to OBS_Search') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetAvailableBoundaries( username TEXT, @@ -1113,7 +1113,7 @@ RETURNS TABLE(boundary_id text, description text, time_span text, tablename text raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundary( username TEXT, orgname TEXT, @@ -1165,7 +1165,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundary') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryId( username TEXT, @@ -1218,7 +1218,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetBoundaryId') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryById( username TEXT, @@ -1271,7 +1271,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundaryById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByGeometry( username TEXT, @@ -1331,7 +1331,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByPointAndRadius( username TEXT, @@ -1393,7 +1393,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByGeometry( username TEXT, @@ -1453,7 +1453,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByPointAndRadius( username TEXT, @@ -1515,7 +1515,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE TYPE cdb_dataservices_server.ds_fdw_metadata as (schemaname text, tabname text, servername text); CREATE TYPE cdb_dataservices_server.ds_return_metadata as (colnames text[], coltypes text[]); @@ -1526,7 +1526,7 @@ RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ return plpy.execute("SELECT * FROM cdb_dataservices_server.__DST_ConnectUserTable({username}::text, {orgname}::text, {user_db_role}::text, {schema}::text, {dbname}::text, {host_addr}::text, {table_name}::text)" .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), user_db_role=plpy.quote_literal(user_db_role), schema=plpy.quote_literal(input_schema), dbname=plpy.quote_literal(dbname), table_name=plpy.quote_literal(table_name), host_addr=plpy.quote_literal(host_addr)) )[0] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.__DST_ConnectUserTable(username text, orgname text, user_db_role text, input_schema text, dbname text, host_addr text, table_name text) RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ @@ -1655,7 +1655,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1693,7 +1693,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1707,7 +1707,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1721,7 +1721,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1735,7 +1735,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1749,7 +1749,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1763,7 +1763,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_type inner join pg_namespace ON (pg_type.typnamespace = pg_namespace.oid) @@ -1855,7 +1855,7 @@ RETURNS SETOF cdb_dataservices_server.service_quota_info AS $$ ret += [[service, monthly_quota, used_quota, soft_limit, provider]] return ret -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_enough_quota( @@ -1903,7 +1903,7 @@ RETURNS Geometry AS $$ else: raise Exception('Requested geocoder is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) @@ -1919,7 +1919,7 @@ RETURNS Geometry AS $$ else: raise Exception('Here geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1934,7 +1934,7 @@ RETURNS Geometry AS $$ else: raise Exception('Google geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1947,7 +1947,7 @@ RETURNS Geometry AS $$ mapzen_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapzen_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapzen_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1960,7 +1960,7 @@ RETURNS Geometry AS $$ mapzen_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapbox_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapzen_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1989,7 +1989,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using here maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2018,7 +2018,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using google maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2056,7 +2056,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapzen') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2099,7 +2099,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapbox') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_get_rate_limit( username TEXT, @@ -2118,7 +2118,7 @@ RETURNS JSON AS $$ return json.dumps({'limit': rate_limit_config.limit, 'period': rate_limit_config.period}) else: return None -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_user_rate_limit( username TEXT, @@ -2142,7 +2142,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_user_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_org_rate_limit( username TEXT, @@ -2166,7 +2166,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_org_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_server_rate_limit( username TEXT, @@ -2190,7 +2190,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_server_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin0_polygon(username text, orgname text, country_name text) RETURNS Geometry AS $$ from cartodb_services.metrics import QuotaService @@ -2225,7 +2225,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin0 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2282,7 +2282,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_admin1_polygon(admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin1_polygon(username text, orgname text, admin1_name text, country_name text) @@ -2320,7 +2320,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2393,7 +2393,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3) as point;", ["text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, country_name text) @@ -2413,7 +2413,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, NULL, $4) as point;", ["text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, admin1_name text, country_name text) @@ -2433,7 +2433,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, $4, $5) as point;", ["text", "text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, admin1_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_internal_geocode_namedplace(username text, orgname text, city_name text, admin1_name text DEFAULT NULL, country_name text DEFAULT NULL) RETURNS Geometry AS $$ @@ -2476,7 +2476,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode namedplace point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2580,7 +2580,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -2622,7 +2622,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -2664,7 +2664,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -2707,7 +2707,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -2843,7 +2843,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2932,7 +2932,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isodistance( username TEXT, @@ -2998,7 +2998,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isodistance( username TEXT, @@ -3063,7 +3063,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isochrones( username TEXT, @@ -3126,7 +3126,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isochrones( username TEXT, @@ -3187,7 +3187,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -3216,7 +3216,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3231,7 +3231,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3245,7 +3245,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapbox isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3259,7 +3259,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -3288,7 +3288,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3303,7 +3303,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3316,7 +3316,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapzen_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapzen_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapbox isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3329,7 +3329,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapbox_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapbox_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; DO $$ BEGIN IF NOT EXISTS ( diff --git a/server/extension/old_versions/cdb_dataservices_server--0.30.2--0.30.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.30.2--0.30.1.sql index b1c18f5..53bede2 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.30.2--0.30.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.30.2--0.30.1.sql @@ -30,7 +30,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using here maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -68,7 +68,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapzen') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -111,4 +111,4 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapbox') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.30.2--0.30.3.sql b/server/extension/old_versions/cdb_dataservices_server--0.30.2--0.30.3.sql index cde5eb6..a07a840 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.30.2--0.30.3.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.30.2--0.30.3.sql @@ -67,4 +67,4 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.30.2.sql b/server/extension/old_versions/cdb_dataservices_server--0.30.2.sql index 09701f4..7e9a231 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.30.2.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.30.2.sql @@ -66,7 +66,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate Mapbox routing') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_route_with_waypoints( username TEXT, @@ -127,7 +127,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -161,7 +161,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_with_waypoints( @@ -194,7 +194,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- Get the connection to redis from cache or create a new one CREATE OR REPLACE FUNCTION cdb_dataservices_server._connect_to_redis(user_id text) RETURNS boolean AS $$ @@ -212,7 +212,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- -- Observatory connection config -- @@ -229,7 +229,7 @@ RETURNS text AS $$ user_obs_config = GD["user_obs_snapshot_config_{0}".format(username)] return user_obs_config.connection_str -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshotJSON( username TEXT, @@ -283,7 +283,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshot( username TEXT, @@ -340,7 +340,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshotJSON( username TEXT, @@ -392,7 +392,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_segment_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshot( username TEXT, @@ -447,7 +447,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to OBS_GetSegmentSnapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasure( username TEXT, @@ -504,7 +504,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetCategory( username TEXT, @@ -559,7 +559,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusMeasure( username TEXT, @@ -616,7 +616,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetUSCensusMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusCategory( username TEXT, @@ -671,7 +671,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetUSCensusCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPopulation( username TEXT, @@ -726,7 +726,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetPopulation') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasureById( username TEXT, @@ -781,7 +781,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -842,7 +842,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomvals)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -903,7 +903,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomrefs)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeta( username TEXT, @@ -951,7 +951,7 @@ RETURNS JSON AS $$ import sys logger.error('Error trying to OBS_GetMeta', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_GetMeta') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_MetadataValidation( username TEXT, @@ -997,7 +997,7 @@ RETURNS TABLE(valid boolean, errors text[]) AS $$ import sys logger.error('Error trying to OBS_MetadataValidation', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_MetadataValidation') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_Search( username TEXT, orgname TEXT, @@ -1055,7 +1055,7 @@ RETURNS TABLE(id text, description text, name text, aggregate text, source text) raise Exception('Error trying to OBS_Search') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetAvailableBoundaries( username TEXT, @@ -1113,7 +1113,7 @@ RETURNS TABLE(boundary_id text, description text, time_span text, tablename text raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundary( username TEXT, orgname TEXT, @@ -1165,7 +1165,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundary') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryId( username TEXT, @@ -1218,7 +1218,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetBoundaryId') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryById( username TEXT, @@ -1271,7 +1271,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundaryById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByGeometry( username TEXT, @@ -1331,7 +1331,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByPointAndRadius( username TEXT, @@ -1393,7 +1393,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByGeometry( username TEXT, @@ -1453,7 +1453,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByPointAndRadius( username TEXT, @@ -1515,7 +1515,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE TYPE cdb_dataservices_server.ds_fdw_metadata as (schemaname text, tabname text, servername text); CREATE TYPE cdb_dataservices_server.ds_return_metadata as (colnames text[], coltypes text[]); @@ -1526,7 +1526,7 @@ RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ return plpy.execute("SELECT * FROM cdb_dataservices_server.__DST_ConnectUserTable({username}::text, {orgname}::text, {user_db_role}::text, {schema}::text, {dbname}::text, {host_addr}::text, {table_name}::text)" .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), user_db_role=plpy.quote_literal(user_db_role), schema=plpy.quote_literal(input_schema), dbname=plpy.quote_literal(dbname), table_name=plpy.quote_literal(table_name), host_addr=plpy.quote_literal(host_addr)) )[0] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.__DST_ConnectUserTable(username text, orgname text, user_db_role text, input_schema text, dbname text, host_addr text, table_name text) RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ @@ -1655,7 +1655,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1693,7 +1693,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1707,7 +1707,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1721,7 +1721,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1735,7 +1735,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1749,7 +1749,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1763,7 +1763,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_type inner join pg_namespace ON (pg_type.typnamespace = pg_namespace.oid) @@ -1855,7 +1855,7 @@ RETURNS SETOF cdb_dataservices_server.service_quota_info AS $$ ret += [[service, monthly_quota, used_quota, soft_limit, provider]] return ret -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_enough_quota( @@ -1903,7 +1903,7 @@ RETURNS Geometry AS $$ else: raise Exception('Requested geocoder is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) @@ -1919,7 +1919,7 @@ RETURNS Geometry AS $$ else: raise Exception('Here geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1934,7 +1934,7 @@ RETURNS Geometry AS $$ else: raise Exception('Google geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1947,7 +1947,7 @@ RETURNS Geometry AS $$ mapzen_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapzen_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapzen_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1960,7 +1960,7 @@ RETURNS Geometry AS $$ mapzen_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapbox_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapzen_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1993,7 +1993,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using here maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2022,7 +2022,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using google maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2063,7 +2063,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapzen') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2109,7 +2109,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapbox') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_get_rate_limit( username TEXT, @@ -2128,7 +2128,7 @@ RETURNS JSON AS $$ return json.dumps({'limit': rate_limit_config.limit, 'period': rate_limit_config.period}) else: return None -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_user_rate_limit( username TEXT, @@ -2152,7 +2152,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_user_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_org_rate_limit( username TEXT, @@ -2176,7 +2176,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_org_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_server_rate_limit( username TEXT, @@ -2200,7 +2200,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_server_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin0_polygon(username text, orgname text, country_name text) RETURNS Geometry AS $$ from cartodb_services.metrics import QuotaService @@ -2235,7 +2235,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin0 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2292,7 +2292,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_admin1_polygon(admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin1_polygon(username text, orgname text, admin1_name text, country_name text) @@ -2330,7 +2330,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2403,7 +2403,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3) as point;", ["text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, country_name text) @@ -2423,7 +2423,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, NULL, $4) as point;", ["text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, admin1_name text, country_name text) @@ -2443,7 +2443,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, $4, $5) as point;", ["text", "text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, admin1_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_internal_geocode_namedplace(username text, orgname text, city_name text, admin1_name text DEFAULT NULL, country_name text DEFAULT NULL) RETURNS Geometry AS $$ @@ -2486,7 +2486,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode namedplace point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2590,7 +2590,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -2632,7 +2632,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -2674,7 +2674,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -2717,7 +2717,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -2853,7 +2853,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2942,7 +2942,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isodistance( username TEXT, @@ -3008,7 +3008,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isodistance( username TEXT, @@ -3073,7 +3073,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isochrones( username TEXT, @@ -3136,7 +3136,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isochrones( username TEXT, @@ -3197,7 +3197,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -3226,7 +3226,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3241,7 +3241,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3255,7 +3255,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapbox isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3269,7 +3269,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -3298,7 +3298,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3313,7 +3313,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3326,7 +3326,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapzen_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapzen_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapbox isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3339,7 +3339,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapbox_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapbox_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; DO $$ BEGIN IF NOT EXISTS ( diff --git a/server/extension/old_versions/cdb_dataservices_server--0.30.3--0.30.2.sql b/server/extension/old_versions/cdb_dataservices_server--0.30.3--0.30.2.sql index 79f008f..d950acb 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.30.3--0.30.2.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.30.3--0.30.2.sql @@ -67,4 +67,4 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.30.3--0.30.4.sql b/server/extension/old_versions/cdb_dataservices_server--0.30.3--0.30.4.sql index d1054e1..5db9881 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.30.3--0.30.4.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.30.3--0.30.4.sql @@ -66,4 +66,4 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.30.3.sql b/server/extension/old_versions/cdb_dataservices_server--0.30.3.sql index 5a792fd..62baa15 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.30.3.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.30.3.sql @@ -66,7 +66,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate Mapbox routing') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_route_with_waypoints( username TEXT, @@ -127,7 +127,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -161,7 +161,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_with_waypoints( @@ -194,7 +194,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- Get the connection to redis from cache or create a new one CREATE OR REPLACE FUNCTION cdb_dataservices_server._connect_to_redis(user_id text) RETURNS boolean AS $$ @@ -212,7 +212,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- -- Observatory connection config -- @@ -229,7 +229,7 @@ RETURNS text AS $$ user_obs_config = GD["user_obs_snapshot_config_{0}".format(username)] return user_obs_config.connection_str -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshotJSON( username TEXT, @@ -283,7 +283,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshot( username TEXT, @@ -340,7 +340,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshotJSON( username TEXT, @@ -392,7 +392,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_segment_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshot( username TEXT, @@ -447,7 +447,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to OBS_GetSegmentSnapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasure( username TEXT, @@ -504,7 +504,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetCategory( username TEXT, @@ -559,7 +559,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusMeasure( username TEXT, @@ -616,7 +616,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetUSCensusMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusCategory( username TEXT, @@ -671,7 +671,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetUSCensusCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPopulation( username TEXT, @@ -726,7 +726,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetPopulation') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasureById( username TEXT, @@ -781,7 +781,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -842,7 +842,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomvals)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -903,7 +903,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomrefs)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeta( username TEXT, @@ -951,7 +951,7 @@ RETURNS JSON AS $$ import sys logger.error('Error trying to OBS_GetMeta', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_GetMeta') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_MetadataValidation( username TEXT, @@ -997,7 +997,7 @@ RETURNS TABLE(valid boolean, errors text[]) AS $$ import sys logger.error('Error trying to OBS_MetadataValidation', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_MetadataValidation') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_Search( username TEXT, orgname TEXT, @@ -1055,7 +1055,7 @@ RETURNS TABLE(id text, description text, name text, aggregate text, source text) raise Exception('Error trying to OBS_Search') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetAvailableBoundaries( username TEXT, @@ -1113,7 +1113,7 @@ RETURNS TABLE(boundary_id text, description text, time_span text, tablename text raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundary( username TEXT, orgname TEXT, @@ -1165,7 +1165,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundary') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryId( username TEXT, @@ -1218,7 +1218,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetBoundaryId') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryById( username TEXT, @@ -1271,7 +1271,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundaryById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByGeometry( username TEXT, @@ -1331,7 +1331,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByPointAndRadius( username TEXT, @@ -1393,7 +1393,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByGeometry( username TEXT, @@ -1453,7 +1453,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByPointAndRadius( username TEXT, @@ -1515,7 +1515,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE TYPE cdb_dataservices_server.ds_fdw_metadata as (schemaname text, tabname text, servername text); CREATE TYPE cdb_dataservices_server.ds_return_metadata as (colnames text[], coltypes text[]); @@ -1526,7 +1526,7 @@ RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ return plpy.execute("SELECT * FROM cdb_dataservices_server.__DST_ConnectUserTable({username}::text, {orgname}::text, {user_db_role}::text, {schema}::text, {dbname}::text, {host_addr}::text, {table_name}::text)" .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), user_db_role=plpy.quote_literal(user_db_role), schema=plpy.quote_literal(input_schema), dbname=plpy.quote_literal(dbname), table_name=plpy.quote_literal(table_name), host_addr=plpy.quote_literal(host_addr)) )[0] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.__DST_ConnectUserTable(username text, orgname text, user_db_role text, input_schema text, dbname text, host_addr text, table_name text) RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ @@ -1655,7 +1655,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1693,7 +1693,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1707,7 +1707,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1721,7 +1721,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1735,7 +1735,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1749,7 +1749,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1763,7 +1763,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_type inner join pg_namespace ON (pg_type.typnamespace = pg_namespace.oid) @@ -1855,7 +1855,7 @@ RETURNS SETOF cdb_dataservices_server.service_quota_info AS $$ ret += [[service, monthly_quota, used_quota, soft_limit, provider]] return ret -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_enough_quota( @@ -1903,7 +1903,7 @@ RETURNS Geometry AS $$ else: raise Exception('Requested geocoder is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) @@ -1919,7 +1919,7 @@ RETURNS Geometry AS $$ else: raise Exception('Here geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1934,7 +1934,7 @@ RETURNS Geometry AS $$ else: raise Exception('Google geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1947,7 +1947,7 @@ RETURNS Geometry AS $$ mapzen_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapzen_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapzen_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1960,7 +1960,7 @@ RETURNS Geometry AS $$ mapzen_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapbox_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapzen_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1993,7 +1993,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using here maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2025,7 +2025,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using google maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2066,7 +2066,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapzen') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2112,7 +2112,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapbox') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_get_rate_limit( username TEXT, @@ -2131,7 +2131,7 @@ RETURNS JSON AS $$ return json.dumps({'limit': rate_limit_config.limit, 'period': rate_limit_config.period}) else: return None -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_user_rate_limit( username TEXT, @@ -2155,7 +2155,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_user_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_org_rate_limit( username TEXT, @@ -2179,7 +2179,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_org_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_server_rate_limit( username TEXT, @@ -2203,7 +2203,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_server_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin0_polygon(username text, orgname text, country_name text) RETURNS Geometry AS $$ from cartodb_services.metrics import QuotaService @@ -2238,7 +2238,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin0 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2295,7 +2295,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_admin1_polygon(admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin1_polygon(username text, orgname text, admin1_name text, country_name text) @@ -2333,7 +2333,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2406,7 +2406,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3) as point;", ["text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, country_name text) @@ -2426,7 +2426,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, NULL, $4) as point;", ["text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, admin1_name text, country_name text) @@ -2446,7 +2446,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, $4, $5) as point;", ["text", "text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, admin1_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_internal_geocode_namedplace(username text, orgname text, city_name text, admin1_name text DEFAULT NULL, country_name text DEFAULT NULL) RETURNS Geometry AS $$ @@ -2489,7 +2489,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode namedplace point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2593,7 +2593,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -2635,7 +2635,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -2677,7 +2677,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -2720,7 +2720,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -2856,7 +2856,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2945,7 +2945,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isodistance( username TEXT, @@ -3011,7 +3011,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isodistance( username TEXT, @@ -3076,7 +3076,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isochrones( username TEXT, @@ -3139,7 +3139,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isochrones( username TEXT, @@ -3200,7 +3200,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -3229,7 +3229,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3244,7 +3244,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3258,7 +3258,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapbox isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3272,7 +3272,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -3301,7 +3301,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3316,7 +3316,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3329,7 +3329,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapzen_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapzen_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapbox isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3342,7 +3342,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapbox_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapbox_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; DO $$ BEGIN IF NOT EXISTS ( diff --git a/server/extension/old_versions/cdb_dataservices_server--0.30.4--0.30.3.sql b/server/extension/old_versions/cdb_dataservices_server--0.30.4--0.30.3.sql index c197e24..b875bdb 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.30.4--0.30.3.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.30.4--0.30.3.sql @@ -66,4 +66,4 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.30.4--0.30.5.sql b/server/extension/old_versions/cdb_dataservices_server--0.30.4--0.30.5.sql index 0fd3387..7f5648a 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.30.4--0.30.5.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.30.4--0.30.5.sql @@ -65,4 +65,4 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.30.4.sql b/server/extension/old_versions/cdb_dataservices_server--0.30.4.sql index e05a69f..db7b1ba 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.30.4.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.30.4.sql @@ -66,7 +66,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate Mapbox routing') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_route_with_waypoints( username TEXT, @@ -127,7 +127,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -161,7 +161,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_with_waypoints( @@ -194,7 +194,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- Get the connection to redis from cache or create a new one CREATE OR REPLACE FUNCTION cdb_dataservices_server._connect_to_redis(user_id text) RETURNS boolean AS $$ @@ -212,7 +212,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- -- Observatory connection config -- @@ -229,7 +229,7 @@ RETURNS text AS $$ user_obs_config = GD["user_obs_snapshot_config_{0}".format(username)] return user_obs_config.connection_str -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshotJSON( username TEXT, @@ -283,7 +283,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshot( username TEXT, @@ -340,7 +340,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshotJSON( username TEXT, @@ -392,7 +392,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_segment_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshot( username TEXT, @@ -447,7 +447,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to OBS_GetSegmentSnapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasure( username TEXT, @@ -504,7 +504,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetCategory( username TEXT, @@ -559,7 +559,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusMeasure( username TEXT, @@ -616,7 +616,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetUSCensusMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusCategory( username TEXT, @@ -671,7 +671,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetUSCensusCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPopulation( username TEXT, @@ -726,7 +726,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetPopulation') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasureById( username TEXT, @@ -781,7 +781,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -842,7 +842,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomvals)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -903,7 +903,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomrefs)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeta( username TEXT, @@ -951,7 +951,7 @@ RETURNS JSON AS $$ import sys logger.error('Error trying to OBS_GetMeta', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_GetMeta') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_MetadataValidation( username TEXT, @@ -997,7 +997,7 @@ RETURNS TABLE(valid boolean, errors text[]) AS $$ import sys logger.error('Error trying to OBS_MetadataValidation', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_MetadataValidation') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_Search( username TEXT, orgname TEXT, @@ -1055,7 +1055,7 @@ RETURNS TABLE(id text, description text, name text, aggregate text, source text) raise Exception('Error trying to OBS_Search') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetAvailableBoundaries( username TEXT, @@ -1113,7 +1113,7 @@ RETURNS TABLE(boundary_id text, description text, time_span text, tablename text raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundary( username TEXT, orgname TEXT, @@ -1165,7 +1165,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundary') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryId( username TEXT, @@ -1218,7 +1218,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetBoundaryId') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryById( username TEXT, @@ -1271,7 +1271,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundaryById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByGeometry( username TEXT, @@ -1331,7 +1331,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByPointAndRadius( username TEXT, @@ -1393,7 +1393,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByGeometry( username TEXT, @@ -1453,7 +1453,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByPointAndRadius( username TEXT, @@ -1515,7 +1515,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE TYPE cdb_dataservices_server.ds_fdw_metadata as (schemaname text, tabname text, servername text); CREATE TYPE cdb_dataservices_server.ds_return_metadata as (colnames text[], coltypes text[]); @@ -1526,7 +1526,7 @@ RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ return plpy.execute("SELECT * FROM cdb_dataservices_server.__DST_ConnectUserTable({username}::text, {orgname}::text, {user_db_role}::text, {schema}::text, {dbname}::text, {host_addr}::text, {table_name}::text)" .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), user_db_role=plpy.quote_literal(user_db_role), schema=plpy.quote_literal(input_schema), dbname=plpy.quote_literal(dbname), table_name=plpy.quote_literal(table_name), host_addr=plpy.quote_literal(host_addr)) )[0] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.__DST_ConnectUserTable(username text, orgname text, user_db_role text, input_schema text, dbname text, host_addr text, table_name text) RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ @@ -1655,7 +1655,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1693,7 +1693,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1707,7 +1707,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1721,7 +1721,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1735,7 +1735,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1749,7 +1749,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1763,7 +1763,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_type inner join pg_namespace ON (pg_type.typnamespace = pg_namespace.oid) @@ -1855,7 +1855,7 @@ RETURNS SETOF cdb_dataservices_server.service_quota_info AS $$ ret += [[service, monthly_quota, used_quota, soft_limit, provider]] return ret -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_enough_quota( @@ -1903,7 +1903,7 @@ RETURNS Geometry AS $$ else: raise Exception('Requested geocoder is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) @@ -1919,7 +1919,7 @@ RETURNS Geometry AS $$ else: raise Exception('Here geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1934,7 +1934,7 @@ RETURNS Geometry AS $$ else: raise Exception('Google geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1947,7 +1947,7 @@ RETURNS Geometry AS $$ mapzen_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapzen_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapzen_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1960,7 +1960,7 @@ RETURNS Geometry AS $$ mapzen_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapbox_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapzen_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1993,7 +1993,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using here maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2025,7 +2025,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using google maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2066,7 +2066,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapzen') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2112,7 +2112,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapbox') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_get_rate_limit( username TEXT, @@ -2131,7 +2131,7 @@ RETURNS JSON AS $$ return json.dumps({'limit': rate_limit_config.limit, 'period': rate_limit_config.period}) else: return None -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_user_rate_limit( username TEXT, @@ -2155,7 +2155,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_user_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_org_rate_limit( username TEXT, @@ -2179,7 +2179,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_org_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_server_rate_limit( username TEXT, @@ -2203,7 +2203,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_server_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin0_polygon(username text, orgname text, country_name text) RETURNS Geometry AS $$ from cartodb_services.metrics import QuotaService @@ -2238,7 +2238,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin0 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2295,7 +2295,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_admin1_polygon(admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin1_polygon(username text, orgname text, admin1_name text, country_name text) @@ -2333,7 +2333,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2406,7 +2406,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3) as point;", ["text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, country_name text) @@ -2426,7 +2426,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, NULL, $4) as point;", ["text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, admin1_name text, country_name text) @@ -2446,7 +2446,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, $4, $5) as point;", ["text", "text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, admin1_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_internal_geocode_namedplace(username text, orgname text, city_name text, admin1_name text DEFAULT NULL, country_name text DEFAULT NULL) RETURNS Geometry AS $$ @@ -2489,7 +2489,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode namedplace point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2593,7 +2593,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -2635,7 +2635,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -2677,7 +2677,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -2720,7 +2720,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -2856,7 +2856,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2945,7 +2945,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isodistance( username TEXT, @@ -3011,7 +3011,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isodistance( username TEXT, @@ -3076,7 +3076,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isochrones( username TEXT, @@ -3139,7 +3139,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isochrones( username TEXT, @@ -3200,7 +3200,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -3229,7 +3229,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3244,7 +3244,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3258,7 +3258,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapbox isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3272,7 +3272,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -3301,7 +3301,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3316,7 +3316,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3329,7 +3329,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapzen_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapzen_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapbox isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3342,7 +3342,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapbox_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapbox_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; DO $$ BEGIN IF NOT EXISTS ( diff --git a/server/extension/old_versions/cdb_dataservices_server--0.30.5--0.30.4.sql b/server/extension/old_versions/cdb_dataservices_server--0.30.5--0.30.4.sql index 11ed9b6..eaff320 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.30.5--0.30.4.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.30.5--0.30.4.sql @@ -65,4 +65,4 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.30.5--0.31.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.30.5--0.31.0.sql index f7bb9ba..cf67925 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.30.5--0.31.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.30.5--0.31.0.sql @@ -62,7 +62,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate TomTom routing') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( @@ -104,7 +104,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_with_waypoints( @@ -143,7 +143,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) @@ -179,7 +179,7 @@ RETURNS Geometry AS $$ else: raise Exception('Requested geocoder is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_tomtom_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) @@ -193,7 +193,7 @@ RETURNS Geometry AS $$ tomtom_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_tomtom_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(tomtom_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) @@ -240,7 +240,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using TomTom') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_isodistance( @@ -305,7 +305,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get TomTom isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_isochrones( @@ -366,7 +366,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get TomTom isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -402,7 +402,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- tomtom isodistance @@ -417,7 +417,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -453,7 +453,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- tomtom isochrone @@ -467,4 +467,4 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ tomtom_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_tomtom_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.30.5.sql b/server/extension/old_versions/cdb_dataservices_server--0.30.5.sql index 49b52b1..f8c24a5 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.30.5.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.30.5.sql @@ -66,7 +66,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate Mapbox routing') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE ; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_route_with_waypoints( username TEXT, @@ -127,7 +127,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE ; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -161,7 +161,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_with_waypoints( @@ -194,7 +194,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; -- Get the connection to redis from cache or create a new one CREATE OR REPLACE FUNCTION cdb_dataservices_server._connect_to_redis(user_id text) RETURNS boolean AS $$ @@ -212,7 +212,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE ; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE ; -- -- Observatory connection config -- @@ -229,7 +229,7 @@ RETURNS text AS $$ user_obs_config = GD["user_obs_snapshot_config_{0}".format(username)] return user_obs_config.connection_str -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshotJSON( username TEXT, @@ -283,7 +283,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshot( username TEXT, @@ -340,7 +340,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshotJSON( username TEXT, @@ -392,7 +392,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_segment_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshot( username TEXT, @@ -447,7 +447,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to OBS_GetSegmentSnapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasure( username TEXT, @@ -504,7 +504,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetCategory( username TEXT, @@ -559,7 +559,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusMeasure( username TEXT, @@ -616,7 +616,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetUSCensusMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusCategory( username TEXT, @@ -671,7 +671,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetUSCensusCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPopulation( username TEXT, @@ -726,7 +726,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetPopulation') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasureById( username TEXT, @@ -781,7 +781,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -842,7 +842,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomvals)) -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -903,7 +903,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomrefs)) -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeta( username TEXT, @@ -951,7 +951,7 @@ RETURNS JSON AS $$ import sys logger.error('Error trying to OBS_GetMeta', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_GetMeta') -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_MetadataValidation( username TEXT, @@ -997,7 +997,7 @@ RETURNS TABLE(valid boolean, errors text[]) AS $$ import sys logger.error('Error trying to OBS_MetadataValidation', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_MetadataValidation') -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_Search( username TEXT, orgname TEXT, @@ -1055,7 +1055,7 @@ RETURNS TABLE(id text, description text, name text, aggregate text, source text) raise Exception('Error trying to OBS_Search') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetAvailableBoundaries( username TEXT, @@ -1113,7 +1113,7 @@ RETURNS TABLE(boundary_id text, description text, time_span text, tablename text raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundary( username TEXT, orgname TEXT, @@ -1165,7 +1165,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundary') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryId( username TEXT, @@ -1218,7 +1218,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetBoundaryId') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryById( username TEXT, @@ -1271,7 +1271,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundaryById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByGeometry( username TEXT, @@ -1331,7 +1331,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByPointAndRadius( username TEXT, @@ -1393,7 +1393,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByGeometry( username TEXT, @@ -1453,7 +1453,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByPointAndRadius( username TEXT, @@ -1515,7 +1515,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE TYPE cdb_dataservices_server.ds_fdw_metadata as (schemaname text, tabname text, servername text); CREATE TYPE cdb_dataservices_server.ds_return_metadata as (colnames text[], coltypes text[]); @@ -1526,7 +1526,7 @@ RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ return plpy.execute("SELECT * FROM cdb_dataservices_server.__DST_ConnectUserTable({username}::text, {orgname}::text, {user_db_role}::text, {schema}::text, {dbname}::text, {host_addr}::text, {table_name}::text)" .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), user_db_role=plpy.quote_literal(user_db_role), schema=plpy.quote_literal(input_schema), dbname=plpy.quote_literal(dbname), table_name=plpy.quote_literal(table_name), host_addr=plpy.quote_literal(host_addr)) )[0] -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server.__DST_ConnectUserTable(username text, orgname text, user_db_role text, input_schema text, dbname text, host_addr text, table_name text) RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ @@ -1655,7 +1655,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE ; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE ; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1693,7 +1693,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE ; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1707,7 +1707,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE ; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1721,7 +1721,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE ; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1735,7 +1735,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1749,7 +1749,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE ; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1763,7 +1763,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE ; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE ; DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_type inner join pg_namespace ON (pg_type.typnamespace = pg_namespace.oid) @@ -1855,7 +1855,7 @@ RETURNS SETOF cdb_dataservices_server.service_quota_info AS $$ ret += [[service, monthly_quota, used_quota, soft_limit, provider]] return ret -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_enough_quota( @@ -1903,7 +1903,7 @@ RETURNS Geometry AS $$ else: raise Exception('Requested geocoder is not available') -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) @@ -1919,7 +1919,7 @@ RETURNS Geometry AS $$ else: raise Exception('Here geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1934,7 +1934,7 @@ RETURNS Geometry AS $$ else: raise Exception('Google geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1947,7 +1947,7 @@ RETURNS Geometry AS $$ mapzen_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapzen_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapzen_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1960,7 +1960,7 @@ RETURNS Geometry AS $$ mapzen_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapbox_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapzen_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1993,7 +1993,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using here maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2025,7 +2025,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using google maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2066,7 +2066,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapzen') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2112,7 +2112,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapbox') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_get_rate_limit( username TEXT, @@ -2131,7 +2131,7 @@ RETURNS JSON AS $$ return json.dumps({'limit': rate_limit_config.limit, 'period': rate_limit_config.period}) else: return None -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_user_rate_limit( username TEXT, @@ -2155,7 +2155,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_user_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE ; +$$ LANGUAGE plpythonu VOLATILE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_org_rate_limit( username TEXT, @@ -2179,7 +2179,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_org_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_server_rate_limit( username TEXT, @@ -2203,7 +2203,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_server_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE ; +$$ LANGUAGE plpythonu VOLATILE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin0_polygon(username text, orgname text, country_name text) RETURNS Geometry AS $$ from cartodb_services.metrics import QuotaService @@ -2238,7 +2238,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin0 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; -------------------------------------------------------------------------------- @@ -2295,7 +2295,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; ---- cdb_geocode_admin1_polygon(admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin1_polygon(username text, orgname text, admin1_name text, country_name text) @@ -2333,7 +2333,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; -------------------------------------------------------------------------------- @@ -2406,7 +2406,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3) as point;", ["text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; ---- cdb_geocode_namedplace_point(city_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, country_name text) @@ -2426,7 +2426,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, NULL, $4) as point;", ["text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; ---- cdb_geocode_namedplace_point(city_name text, admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, admin1_name text, country_name text) @@ -2446,7 +2446,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, $4, $5) as point;", ["text", "text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, admin1_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_internal_geocode_namedplace(username text, orgname text, city_name text, admin1_name text DEFAULT NULL, country_name text DEFAULT NULL) RETURNS Geometry AS $$ @@ -2489,7 +2489,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode namedplace point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; -------------------------------------------------------------------------------- @@ -2593,7 +2593,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -2635,7 +2635,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -2677,7 +2677,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -2720,7 +2720,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -2856,7 +2856,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; -------------------------------------------------------------------------------- @@ -2945,7 +2945,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE ; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isodistance( username TEXT, @@ -3011,7 +3011,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE ; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isodistance( username TEXT, @@ -3076,7 +3076,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE ; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isochrones( username TEXT, @@ -3139,7 +3139,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE ; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isochrones( username TEXT, @@ -3200,7 +3200,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE ; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -3229,7 +3229,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; -- heremaps isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3244,7 +3244,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; -- mapzen isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3258,7 +3258,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; -- mapbox isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3272,7 +3272,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -3301,7 +3301,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; -- heremaps isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3316,7 +3316,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; -- mapzen isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3329,7 +3329,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapzen_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapzen_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; -- mapbox isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3342,7 +3342,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapbox_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapbox_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; DO $$ BEGIN IF NOT EXISTS ( diff --git a/server/extension/old_versions/cdb_dataservices_server--0.31.0--0.30.5.sql b/server/extension/old_versions/cdb_dataservices_server--0.31.0--0.30.5.sql index 157b982..afbd6ad 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.31.0--0.30.5.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.31.0--0.30.5.sql @@ -38,7 +38,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_with_waypoints( @@ -71,7 +71,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) @@ -102,7 +102,7 @@ RETURNS Geometry AS $$ else: raise Exception('Requested geocoder is not available') -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; DROP FUNCTION IF EXISTS cdb_dataservices_server.cdb_tomtom_geocode_street_point(TEXT, TEXT, TEXT, TEXT, TEXT, TEXT); @@ -142,7 +142,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; DROP FUNCTION IF EXISTS cdb_dataservices_server.cdb_tomtom_isodistance(TEXT, TEXT, geometry(Geometry, 4326), TEXT, integer[], text[]); @@ -176,7 +176,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE ; +$$ LANGUAGE plpythonu STABLE ; DROP FUNCTION IF EXISTS cdb_dataservices_server.cdb_tomtom_isochrone(TEXT, TEXT, geometry(Geometry, 4326), TEXT, integer[], text[]); diff --git a/server/extension/old_versions/cdb_dataservices_server--0.31.0--0.32.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.31.0--0.32.0.sql index c5375f8..45faaac 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.31.0--0.32.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.31.0--0.32.0.sql @@ -48,7 +48,7 @@ RETURNS SETOF cdb_dataservices_server.service_quota_info_batch AS $$ ret += [[info['service'], info['monthly_quota'], info['used_quota'], info['soft_limit'], info['provider'], info['max_batch_size']]] return ret -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- TODO: could cartodb_id be replaced by rowid, maybe needing extra care for offset? CREATE TYPE cdb_dataservices_server.geocoding AS ( @@ -89,7 +89,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ plan = plpy.prepare("SELECT * FROM cdb_dataservices_server.{}($1, $2, $3); ".format(provider_function), ["text", "text", "jsonb"]) return plpy.execute(plan, [username, orgname, searches]) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_google_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -100,7 +100,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = LegacyServiceManager('geocoder', username, orgname, GD) geocoder = GoogleMapsBulkGeocoder(service_manager.config.google_client_id, service_manager.config.google_api_key, service_manager.logger) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_heremaps_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -111,7 +111,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = LegacyServiceManager('geocoder', username, orgname, GD) geocoder = HereMapsBulkGeocoder(service_manager.config.heremaps_app_id, service_manager.config.heremaps_app_code, service_manager.logger, service_manager.config.heremaps_service_params) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_tomtom_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -128,7 +128,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = ServiceManager('geocoder', TomTomGeocoderConfigBuilder, username, orgname, GD) geocoder = TomTomBulkGeocoder(service_manager.config.tomtom_api_key, service_manager.logger, service_manager.config.service_params) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_mapbox_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -145,4 +145,4 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = ServiceManager('geocoder', MapboxGeocoderConfigBuilder, username, orgname, GD) geocoder = MapboxBulkGeocoder(service_manager.config.mapbox_api_key, service_manager.logger, service_manager.config.service_params) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.31.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.31.0.sql index d3750f0..2e7b27c 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.31.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.31.0.sql @@ -66,7 +66,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate Mapbox routing') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_route_with_waypoints( username TEXT, @@ -127,7 +127,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate TomTom routing') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_route_with_waypoints( username TEXT, @@ -188,7 +188,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -228,7 +228,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_with_waypoints( @@ -267,7 +267,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- Get the connection to redis from cache or create a new one CREATE OR REPLACE FUNCTION cdb_dataservices_server._connect_to_redis(user_id text) RETURNS boolean AS $$ @@ -285,7 +285,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- -- Observatory connection config -- @@ -302,7 +302,7 @@ RETURNS text AS $$ user_obs_config = GD["user_obs_snapshot_config_{0}".format(username)] return user_obs_config.connection_str -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshotJSON( username TEXT, @@ -356,7 +356,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshot( username TEXT, @@ -413,7 +413,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshotJSON( username TEXT, @@ -465,7 +465,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_segment_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshot( username TEXT, @@ -520,7 +520,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to OBS_GetSegmentSnapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasure( username TEXT, @@ -577,7 +577,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetCategory( username TEXT, @@ -632,7 +632,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusMeasure( username TEXT, @@ -689,7 +689,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetUSCensusMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusCategory( username TEXT, @@ -744,7 +744,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetUSCensusCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPopulation( username TEXT, @@ -799,7 +799,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetPopulation') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasureById( username TEXT, @@ -854,7 +854,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -915,7 +915,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomvals)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -976,7 +976,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomrefs)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeta( username TEXT, @@ -1024,7 +1024,7 @@ RETURNS JSON AS $$ import sys logger.error('Error trying to OBS_GetMeta', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_GetMeta') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_MetadataValidation( username TEXT, @@ -1070,7 +1070,7 @@ RETURNS TABLE(valid boolean, errors text[]) AS $$ import sys logger.error('Error trying to OBS_MetadataValidation', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_MetadataValidation') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_Search( username TEXT, orgname TEXT, @@ -1128,7 +1128,7 @@ RETURNS TABLE(id text, description text, name text, aggregate text, source text) raise Exception('Error trying to OBS_Search') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetAvailableBoundaries( username TEXT, @@ -1186,7 +1186,7 @@ RETURNS TABLE(boundary_id text, description text, time_span text, tablename text raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundary( username TEXT, orgname TEXT, @@ -1238,7 +1238,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundary') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryId( username TEXT, @@ -1291,7 +1291,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetBoundaryId') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryById( username TEXT, @@ -1344,7 +1344,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundaryById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByGeometry( username TEXT, @@ -1404,7 +1404,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByPointAndRadius( username TEXT, @@ -1466,7 +1466,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByGeometry( username TEXT, @@ -1526,7 +1526,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByPointAndRadius( username TEXT, @@ -1588,7 +1588,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE TYPE cdb_dataservices_server.ds_fdw_metadata as (schemaname text, tabname text, servername text); CREATE TYPE cdb_dataservices_server.ds_return_metadata as (colnames text[], coltypes text[]); @@ -1599,7 +1599,7 @@ RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ return plpy.execute("SELECT * FROM cdb_dataservices_server.__DST_ConnectUserTable({username}::text, {orgname}::text, {user_db_role}::text, {schema}::text, {dbname}::text, {host_addr}::text, {table_name}::text)" .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), user_db_role=plpy.quote_literal(user_db_role), schema=plpy.quote_literal(input_schema), dbname=plpy.quote_literal(dbname), table_name=plpy.quote_literal(table_name), host_addr=plpy.quote_literal(host_addr)) )[0] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.__DST_ConnectUserTable(username text, orgname text, user_db_role text, input_schema text, dbname text, host_addr text, table_name text) RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ @@ -1728,7 +1728,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1766,7 +1766,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1780,7 +1780,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1794,7 +1794,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1808,7 +1808,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1822,7 +1822,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1836,7 +1836,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_type inner join pg_namespace ON (pg_type.typnamespace = pg_namespace.oid) @@ -1928,7 +1928,7 @@ RETURNS SETOF cdb_dataservices_server.service_quota_info AS $$ ret += [[service, monthly_quota, used_quota, soft_limit, provider]] return ret -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_enough_quota( @@ -1981,7 +1981,7 @@ RETURNS Geometry AS $$ else: raise Exception('Requested geocoder is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) @@ -1997,7 +1997,7 @@ RETURNS Geometry AS $$ else: raise Exception('Here geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2012,7 +2012,7 @@ RETURNS Geometry AS $$ else: raise Exception('Google geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2025,7 +2025,7 @@ RETURNS Geometry AS $$ mapzen_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapzen_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapzen_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2038,7 +2038,7 @@ RETURNS Geometry AS $$ mapbox_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapbox_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapbox_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_tomtom_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2051,7 +2051,7 @@ RETURNS Geometry AS $$ tomtom_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_tomtom_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(tomtom_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2084,7 +2084,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using here maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2116,7 +2116,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using google maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2157,7 +2157,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapzen') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2203,7 +2203,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using Mapbox') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2249,7 +2249,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using TomTom') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_get_rate_limit( username TEXT, @@ -2268,7 +2268,7 @@ RETURNS JSON AS $$ return json.dumps({'limit': rate_limit_config.limit, 'period': rate_limit_config.period}) else: return None -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_user_rate_limit( username TEXT, @@ -2292,7 +2292,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_user_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_org_rate_limit( username TEXT, @@ -2316,7 +2316,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_org_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_server_rate_limit( username TEXT, @@ -2340,7 +2340,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_server_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin0_polygon(username text, orgname text, country_name text) RETURNS Geometry AS $$ from cartodb_services.metrics import QuotaService @@ -2375,7 +2375,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin0 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2432,7 +2432,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_admin1_polygon(admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin1_polygon(username text, orgname text, admin1_name text, country_name text) @@ -2470,7 +2470,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2543,7 +2543,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3) as point;", ["text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, country_name text) @@ -2563,7 +2563,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, NULL, $4) as point;", ["text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, admin1_name text, country_name text) @@ -2583,7 +2583,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, $4, $5) as point;", ["text", "text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, admin1_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_internal_geocode_namedplace(username text, orgname text, city_name text, admin1_name text DEFAULT NULL, country_name text DEFAULT NULL) RETURNS Geometry AS $$ @@ -2626,7 +2626,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode namedplace point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2730,7 +2730,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -2772,7 +2772,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -2814,7 +2814,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -2857,7 +2857,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -2993,7 +2993,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -3082,7 +3082,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isodistance( username TEXT, @@ -3148,7 +3148,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isodistance( username TEXT, @@ -3213,7 +3213,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_isodistance( username TEXT, @@ -3277,7 +3277,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get TomTom isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isochrones( username TEXT, @@ -3340,7 +3340,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isochrones( username TEXT, @@ -3401,7 +3401,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_isochrones( username TEXT, @@ -3461,7 +3461,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get TomTom isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -3495,7 +3495,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3510,7 +3510,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3524,7 +3524,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapbox isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3538,7 +3538,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- tomtom isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_tomtom_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3552,7 +3552,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -3586,7 +3586,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3601,7 +3601,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3614,7 +3614,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapzen_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapzen_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapbox isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3627,7 +3627,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapbox_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapbox_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- tomtom isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_tomtom_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3640,7 +3640,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ tomtom_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_tomtom_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; DO $$ BEGIN IF NOT EXISTS ( diff --git a/server/extension/old_versions/cdb_dataservices_server--0.32.0--0.33.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.32.0--0.33.0.sql index c29172e..610916d 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.32.0--0.33.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.32.0--0.33.0.sql @@ -15,7 +15,7 @@ RETURNS text AS $$ user_obs_config = GD["user_obs_config_{0}".format(username)] return user_obs_config.connection_str -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.obs_get_demographic_snapshot( username TEXT, @@ -58,7 +58,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetDemographicSnapshot( username TEXT, @@ -104,7 +104,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.obs_get_segment_snapshot( username TEXT, @@ -146,7 +146,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_segment_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshot( username TEXT, @@ -201,4 +201,4 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to OBS_GetSegmentSnapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.32.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.32.0.sql index bb2a283..42d9b9e 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.32.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.32.0.sql @@ -66,7 +66,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate Mapbox routing') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_route_with_waypoints( username TEXT, @@ -127,7 +127,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate TomTom routing') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_route_with_waypoints( username TEXT, @@ -188,7 +188,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -228,7 +228,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_with_waypoints( @@ -267,7 +267,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- Get the connection to redis from cache or create a new one CREATE OR REPLACE FUNCTION cdb_dataservices_server._connect_to_redis(user_id text) RETURNS boolean AS $$ @@ -285,7 +285,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- -- Observatory connection config -- @@ -302,7 +302,7 @@ RETURNS text AS $$ user_obs_config = GD["user_obs_snapshot_config_{0}".format(username)] return user_obs_config.connection_str -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshotJSON( username TEXT, @@ -356,7 +356,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshot( username TEXT, @@ -413,7 +413,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshotJSON( username TEXT, @@ -465,7 +465,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_segment_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshot( username TEXT, @@ -520,7 +520,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to OBS_GetSegmentSnapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasure( username TEXT, @@ -577,7 +577,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetCategory( username TEXT, @@ -632,7 +632,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusMeasure( username TEXT, @@ -689,7 +689,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetUSCensusMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusCategory( username TEXT, @@ -744,7 +744,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetUSCensusCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPopulation( username TEXT, @@ -799,7 +799,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetPopulation') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasureById( username TEXT, @@ -854,7 +854,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -915,7 +915,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomvals)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -976,7 +976,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomrefs)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeta( username TEXT, @@ -1024,7 +1024,7 @@ RETURNS JSON AS $$ import sys logger.error('Error trying to OBS_GetMeta', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_GetMeta') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_MetadataValidation( username TEXT, @@ -1070,7 +1070,7 @@ RETURNS TABLE(valid boolean, errors text[]) AS $$ import sys logger.error('Error trying to OBS_MetadataValidation', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_MetadataValidation') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_Search( username TEXT, orgname TEXT, @@ -1128,7 +1128,7 @@ RETURNS TABLE(id text, description text, name text, aggregate text, source text) raise Exception('Error trying to OBS_Search') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetAvailableBoundaries( username TEXT, @@ -1186,7 +1186,7 @@ RETURNS TABLE(boundary_id text, description text, time_span text, tablename text raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundary( username TEXT, orgname TEXT, @@ -1238,7 +1238,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundary') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryId( username TEXT, @@ -1291,7 +1291,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetBoundaryId') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryById( username TEXT, @@ -1344,7 +1344,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundaryById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByGeometry( username TEXT, @@ -1404,7 +1404,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByPointAndRadius( username TEXT, @@ -1466,7 +1466,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByGeometry( username TEXT, @@ -1526,7 +1526,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByPointAndRadius( username TEXT, @@ -1588,7 +1588,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE TYPE cdb_dataservices_server.ds_fdw_metadata as (schemaname text, tabname text, servername text); CREATE TYPE cdb_dataservices_server.ds_return_metadata as (colnames text[], coltypes text[]); @@ -1599,7 +1599,7 @@ RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ return plpy.execute("SELECT * FROM cdb_dataservices_server.__DST_ConnectUserTable({username}::text, {orgname}::text, {user_db_role}::text, {schema}::text, {dbname}::text, {host_addr}::text, {table_name}::text)" .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), user_db_role=plpy.quote_literal(user_db_role), schema=plpy.quote_literal(input_schema), dbname=plpy.quote_literal(dbname), table_name=plpy.quote_literal(table_name), host_addr=plpy.quote_literal(host_addr)) )[0] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.__DST_ConnectUserTable(username text, orgname text, user_db_role text, input_schema text, dbname text, host_addr text, table_name text) RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ @@ -1728,7 +1728,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1766,7 +1766,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1780,7 +1780,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1794,7 +1794,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1808,7 +1808,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1822,7 +1822,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1836,7 +1836,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_type inner join pg_namespace ON (pg_type.typnamespace = pg_namespace.oid) @@ -1945,7 +1945,7 @@ RETURNS SETOF cdb_dataservices_server.service_quota_info AS $$ ret += [[service, monthly_quota, used_quota, soft_limit, provider]] return ret -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_quota_info_batch( @@ -1975,7 +1975,7 @@ RETURNS SETOF cdb_dataservices_server.service_quota_info_batch AS $$ ret += [[info['service'], info['monthly_quota'], info['used_quota'], info['soft_limit'], info['provider'], info['max_batch_size']]] return ret -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_enough_quota( username TEXT, @@ -2027,7 +2027,7 @@ RETURNS Geometry AS $$ else: raise Exception('Requested geocoder is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) @@ -2043,7 +2043,7 @@ RETURNS Geometry AS $$ else: raise Exception('Here geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2058,7 +2058,7 @@ RETURNS Geometry AS $$ else: raise Exception('Google geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2071,7 +2071,7 @@ RETURNS Geometry AS $$ mapzen_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapzen_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapzen_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2084,7 +2084,7 @@ RETURNS Geometry AS $$ mapbox_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapbox_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapbox_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_tomtom_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2097,7 +2097,7 @@ RETURNS Geometry AS $$ tomtom_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_tomtom_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(tomtom_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2130,7 +2130,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using here maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2162,7 +2162,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using google maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2203,7 +2203,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapzen') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2249,7 +2249,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using Mapbox') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2295,7 +2295,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using TomTom') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_get_rate_limit( username TEXT, @@ -2314,7 +2314,7 @@ RETURNS JSON AS $$ return json.dumps({'limit': rate_limit_config.limit, 'period': rate_limit_config.period}) else: return None -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_user_rate_limit( username TEXT, @@ -2338,7 +2338,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_user_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_org_rate_limit( username TEXT, @@ -2362,7 +2362,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_org_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_server_rate_limit( username TEXT, @@ -2386,7 +2386,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_server_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; -- TODO: could cartodb_id be replaced by rowid, maybe needing extra care for offset? CREATE TYPE cdb_dataservices_server.geocoding AS ( cartodb_id integer, @@ -2426,7 +2426,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ plan = plpy.prepare("SELECT * FROM cdb_dataservices_server.{}($1, $2, $3); ".format(provider_function), ["text", "text", "jsonb"]) return plpy.execute(plan, [username, orgname, searches]) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_google_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2437,7 +2437,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = LegacyServiceManager('geocoder', username, orgname, GD) geocoder = GoogleMapsBulkGeocoder(service_manager.config.google_client_id, service_manager.config.google_api_key, service_manager.logger) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_heremaps_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2448,7 +2448,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = LegacyServiceManager('geocoder', username, orgname, GD) geocoder = HereMapsBulkGeocoder(service_manager.config.heremaps_app_id, service_manager.config.heremaps_app_code, service_manager.logger, service_manager.config.heremaps_service_params) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_tomtom_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2465,7 +2465,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = ServiceManager('geocoder', TomTomGeocoderConfigBuilder, username, orgname, GD) geocoder = TomTomBulkGeocoder(service_manager.config.tomtom_api_key, service_manager.logger, service_manager.config.service_params) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_mapbox_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2482,7 +2482,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = ServiceManager('geocoder', MapboxGeocoderConfigBuilder, username, orgname, GD) geocoder = MapboxBulkGeocoder(service_manager.config.mapbox_api_key, service_manager.logger, service_manager.config.service_params) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin0_polygon(username text, orgname text, country_name text) RETURNS Geometry AS $$ @@ -2518,7 +2518,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin0 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2575,7 +2575,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_admin1_polygon(admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin1_polygon(username text, orgname text, admin1_name text, country_name text) @@ -2613,7 +2613,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2686,7 +2686,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3) as point;", ["text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, country_name text) @@ -2706,7 +2706,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, NULL, $4) as point;", ["text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, admin1_name text, country_name text) @@ -2726,7 +2726,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, $4, $5) as point;", ["text", "text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, admin1_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_internal_geocode_namedplace(username text, orgname text, city_name text, admin1_name text DEFAULT NULL, country_name text DEFAULT NULL) RETURNS Geometry AS $$ @@ -2769,7 +2769,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode namedplace point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2873,7 +2873,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -2915,7 +2915,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -2957,7 +2957,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -3000,7 +3000,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -3136,7 +3136,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -3225,7 +3225,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isodistance( username TEXT, @@ -3291,7 +3291,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isodistance( username TEXT, @@ -3356,7 +3356,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_isodistance( username TEXT, @@ -3420,7 +3420,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get TomTom isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isochrones( username TEXT, @@ -3483,7 +3483,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isochrones( username TEXT, @@ -3544,7 +3544,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_isochrones( username TEXT, @@ -3604,7 +3604,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get TomTom isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -3638,7 +3638,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3653,7 +3653,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3667,7 +3667,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapbox isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3681,7 +3681,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- tomtom isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_tomtom_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3695,7 +3695,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -3729,7 +3729,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3744,7 +3744,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3757,7 +3757,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapzen_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapzen_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapbox isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3770,7 +3770,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapbox_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapbox_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- tomtom isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_tomtom_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3783,7 +3783,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ tomtom_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_tomtom_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; DO $$ BEGIN IF NOT EXISTS ( diff --git a/server/extension/old_versions/cdb_dataservices_server--0.33.0--0.32.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.33.0--0.32.0.sql index 0f4ad81..1a30b9d 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.33.0--0.32.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.33.0--0.32.0.sql @@ -15,7 +15,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._obs_server_conn_str( username TEXT, @@ -27,7 +27,7 @@ RETURNS text AS $$ user_obs_config = GD["user_obs_snapshot_config_{0}".format(username)] return user_obs_config.connection_str -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.obs_get_demographic_snapshot( username TEXT, @@ -70,7 +70,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetDemographicSnapshot( username TEXT, @@ -116,7 +116,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.obs_get_segment_snapshot( username TEXT, @@ -158,7 +158,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_segment_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshot( username TEXT, @@ -213,4 +213,4 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to OBS_GetSegmentSnapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.33.0--0.34.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.33.0--0.34.0.sql index 5fb72c9..8c3ede9 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.33.0--0.34.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.33.0--0.34.0.sql @@ -43,7 +43,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_with_waypoints( @@ -82,7 +82,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -117,7 +117,7 @@ RETURNS Geometry AS $$ else: raise Exception('Requested geocoder is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -151,7 +151,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ plan = plpy.prepare("SELECT * FROM cdb_dataservices_server.{}($1, $2, $3); ".format(provider_function), ["text", "text", "jsonb"]) return plpy.execute(plan, [username, orgname, searches]) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin0_polygon(username text, orgname text, country_name text) RETURNS Geometry AS $$ @@ -190,7 +190,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin0 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin1_polygon(username text, orgname text, admin1_name text) RETURNS Geometry AS $$ @@ -229,7 +229,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_internal_geocode_namedplace(username text, orgname text, city_name text, admin1_name text DEFAULT NULL, country_name text DEFAULT NULL) RETURNS Geometry AS $$ @@ -274,7 +274,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode namedplace point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code text) RETURNS Geometry AS $$ @@ -313,7 +313,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_ipaddress_point(username text, orgname text, ip text) RETURNS Geometry AS $$ @@ -352,7 +352,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ @@ -387,7 +387,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ @@ -422,4 +422,4 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.33.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.33.0.sql index bb2a283..42d9b9e 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.33.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.33.0.sql @@ -66,7 +66,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate Mapbox routing') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_route_with_waypoints( username TEXT, @@ -127,7 +127,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate TomTom routing') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_route_with_waypoints( username TEXT, @@ -188,7 +188,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -228,7 +228,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_with_waypoints( @@ -267,7 +267,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- Get the connection to redis from cache or create a new one CREATE OR REPLACE FUNCTION cdb_dataservices_server._connect_to_redis(user_id text) RETURNS boolean AS $$ @@ -285,7 +285,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- -- Observatory connection config -- @@ -302,7 +302,7 @@ RETURNS text AS $$ user_obs_config = GD["user_obs_snapshot_config_{0}".format(username)] return user_obs_config.connection_str -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshotJSON( username TEXT, @@ -356,7 +356,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshot( username TEXT, @@ -413,7 +413,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshotJSON( username TEXT, @@ -465,7 +465,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_segment_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshot( username TEXT, @@ -520,7 +520,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to OBS_GetSegmentSnapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasure( username TEXT, @@ -577,7 +577,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetCategory( username TEXT, @@ -632,7 +632,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusMeasure( username TEXT, @@ -689,7 +689,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetUSCensusMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusCategory( username TEXT, @@ -744,7 +744,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetUSCensusCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPopulation( username TEXT, @@ -799,7 +799,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetPopulation') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasureById( username TEXT, @@ -854,7 +854,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -915,7 +915,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomvals)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -976,7 +976,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomrefs)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeta( username TEXT, @@ -1024,7 +1024,7 @@ RETURNS JSON AS $$ import sys logger.error('Error trying to OBS_GetMeta', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_GetMeta') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_MetadataValidation( username TEXT, @@ -1070,7 +1070,7 @@ RETURNS TABLE(valid boolean, errors text[]) AS $$ import sys logger.error('Error trying to OBS_MetadataValidation', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_MetadataValidation') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_Search( username TEXT, orgname TEXT, @@ -1128,7 +1128,7 @@ RETURNS TABLE(id text, description text, name text, aggregate text, source text) raise Exception('Error trying to OBS_Search') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetAvailableBoundaries( username TEXT, @@ -1186,7 +1186,7 @@ RETURNS TABLE(boundary_id text, description text, time_span text, tablename text raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundary( username TEXT, orgname TEXT, @@ -1238,7 +1238,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundary') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryId( username TEXT, @@ -1291,7 +1291,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetBoundaryId') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryById( username TEXT, @@ -1344,7 +1344,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundaryById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByGeometry( username TEXT, @@ -1404,7 +1404,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByPointAndRadius( username TEXT, @@ -1466,7 +1466,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByGeometry( username TEXT, @@ -1526,7 +1526,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByPointAndRadius( username TEXT, @@ -1588,7 +1588,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE TYPE cdb_dataservices_server.ds_fdw_metadata as (schemaname text, tabname text, servername text); CREATE TYPE cdb_dataservices_server.ds_return_metadata as (colnames text[], coltypes text[]); @@ -1599,7 +1599,7 @@ RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ return plpy.execute("SELECT * FROM cdb_dataservices_server.__DST_ConnectUserTable({username}::text, {orgname}::text, {user_db_role}::text, {schema}::text, {dbname}::text, {host_addr}::text, {table_name}::text)" .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), user_db_role=plpy.quote_literal(user_db_role), schema=plpy.quote_literal(input_schema), dbname=plpy.quote_literal(dbname), table_name=plpy.quote_literal(table_name), host_addr=plpy.quote_literal(host_addr)) )[0] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.__DST_ConnectUserTable(username text, orgname text, user_db_role text, input_schema text, dbname text, host_addr text, table_name text) RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ @@ -1728,7 +1728,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1766,7 +1766,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1780,7 +1780,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1794,7 +1794,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1808,7 +1808,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1822,7 +1822,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1836,7 +1836,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_type inner join pg_namespace ON (pg_type.typnamespace = pg_namespace.oid) @@ -1945,7 +1945,7 @@ RETURNS SETOF cdb_dataservices_server.service_quota_info AS $$ ret += [[service, monthly_quota, used_quota, soft_limit, provider]] return ret -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_quota_info_batch( @@ -1975,7 +1975,7 @@ RETURNS SETOF cdb_dataservices_server.service_quota_info_batch AS $$ ret += [[info['service'], info['monthly_quota'], info['used_quota'], info['soft_limit'], info['provider'], info['max_batch_size']]] return ret -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_enough_quota( username TEXT, @@ -2027,7 +2027,7 @@ RETURNS Geometry AS $$ else: raise Exception('Requested geocoder is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) @@ -2043,7 +2043,7 @@ RETURNS Geometry AS $$ else: raise Exception('Here geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2058,7 +2058,7 @@ RETURNS Geometry AS $$ else: raise Exception('Google geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2071,7 +2071,7 @@ RETURNS Geometry AS $$ mapzen_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapzen_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapzen_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2084,7 +2084,7 @@ RETURNS Geometry AS $$ mapbox_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapbox_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapbox_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_tomtom_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2097,7 +2097,7 @@ RETURNS Geometry AS $$ tomtom_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_tomtom_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(tomtom_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2130,7 +2130,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using here maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2162,7 +2162,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using google maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2203,7 +2203,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapzen') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2249,7 +2249,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using Mapbox') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2295,7 +2295,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using TomTom') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_get_rate_limit( username TEXT, @@ -2314,7 +2314,7 @@ RETURNS JSON AS $$ return json.dumps({'limit': rate_limit_config.limit, 'period': rate_limit_config.period}) else: return None -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_user_rate_limit( username TEXT, @@ -2338,7 +2338,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_user_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_org_rate_limit( username TEXT, @@ -2362,7 +2362,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_org_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_server_rate_limit( username TEXT, @@ -2386,7 +2386,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_server_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; -- TODO: could cartodb_id be replaced by rowid, maybe needing extra care for offset? CREATE TYPE cdb_dataservices_server.geocoding AS ( cartodb_id integer, @@ -2426,7 +2426,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ plan = plpy.prepare("SELECT * FROM cdb_dataservices_server.{}($1, $2, $3); ".format(provider_function), ["text", "text", "jsonb"]) return plpy.execute(plan, [username, orgname, searches]) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_google_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2437,7 +2437,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = LegacyServiceManager('geocoder', username, orgname, GD) geocoder = GoogleMapsBulkGeocoder(service_manager.config.google_client_id, service_manager.config.google_api_key, service_manager.logger) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_heremaps_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2448,7 +2448,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = LegacyServiceManager('geocoder', username, orgname, GD) geocoder = HereMapsBulkGeocoder(service_manager.config.heremaps_app_id, service_manager.config.heremaps_app_code, service_manager.logger, service_manager.config.heremaps_service_params) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_tomtom_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2465,7 +2465,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = ServiceManager('geocoder', TomTomGeocoderConfigBuilder, username, orgname, GD) geocoder = TomTomBulkGeocoder(service_manager.config.tomtom_api_key, service_manager.logger, service_manager.config.service_params) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_mapbox_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2482,7 +2482,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = ServiceManager('geocoder', MapboxGeocoderConfigBuilder, username, orgname, GD) geocoder = MapboxBulkGeocoder(service_manager.config.mapbox_api_key, service_manager.logger, service_manager.config.service_params) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin0_polygon(username text, orgname text, country_name text) RETURNS Geometry AS $$ @@ -2518,7 +2518,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin0 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2575,7 +2575,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_admin1_polygon(admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin1_polygon(username text, orgname text, admin1_name text, country_name text) @@ -2613,7 +2613,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2686,7 +2686,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3) as point;", ["text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, country_name text) @@ -2706,7 +2706,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, NULL, $4) as point;", ["text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, admin1_name text, country_name text) @@ -2726,7 +2726,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, $4, $5) as point;", ["text", "text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, admin1_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_internal_geocode_namedplace(username text, orgname text, city_name text, admin1_name text DEFAULT NULL, country_name text DEFAULT NULL) RETURNS Geometry AS $$ @@ -2769,7 +2769,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode namedplace point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2873,7 +2873,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -2915,7 +2915,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -2957,7 +2957,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -3000,7 +3000,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -3136,7 +3136,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -3225,7 +3225,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isodistance( username TEXT, @@ -3291,7 +3291,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isodistance( username TEXT, @@ -3356,7 +3356,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_isodistance( username TEXT, @@ -3420,7 +3420,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get TomTom isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isochrones( username TEXT, @@ -3483,7 +3483,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isochrones( username TEXT, @@ -3544,7 +3544,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_isochrones( username TEXT, @@ -3604,7 +3604,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get TomTom isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -3638,7 +3638,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3653,7 +3653,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3667,7 +3667,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapbox isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3681,7 +3681,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- tomtom isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_tomtom_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3695,7 +3695,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -3729,7 +3729,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3744,7 +3744,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3757,7 +3757,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapzen_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapzen_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapbox isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3770,7 +3770,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapbox_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapbox_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- tomtom isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_tomtom_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3783,7 +3783,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ tomtom_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_tomtom_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; DO $$ BEGIN IF NOT EXISTS ( diff --git a/server/extension/old_versions/cdb_dataservices_server--0.34.0--0.33.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.34.0--0.33.0.sql index b46fead..e74ed22 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.34.0--0.33.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.34.0--0.33.0.sql @@ -43,7 +43,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_with_waypoints( @@ -82,7 +82,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -117,7 +117,7 @@ RETURNS Geometry AS $$ else: raise Exception('Requested geocoder is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -151,7 +151,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ plan = plpy.prepare("SELECT * FROM cdb_dataservices_server.{}($1, $2, $3); ".format(provider_function), ["text", "text", "jsonb"]) return plpy.execute(plan, [username, orgname, searches]) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin0_polygon(username text, orgname text, country_name text) RETURNS Geometry AS $$ @@ -187,7 +187,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin0 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin1_polygon(username text, orgname text, admin1_name text) RETURNS Geometry AS $$ @@ -224,7 +224,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_internal_geocode_namedplace(username text, orgname text, city_name text, admin1_name text DEFAULT NULL, country_name text DEFAULT NULL) RETURNS Geometry AS $$ @@ -267,7 +267,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode namedplace point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code text) RETURNS Geometry AS $$ @@ -303,7 +303,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_ipaddress_point(username text, orgname text, ip text) RETURNS Geometry AS $$ @@ -339,7 +339,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ @@ -374,7 +374,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ @@ -409,4 +409,4 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.34.0--0.34.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.34.0--0.34.1.sql index 37b2228..430d384 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.34.0--0.34.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.34.0--0.34.1.sql @@ -62,7 +62,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isochrones( username TEXT, @@ -121,7 +121,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_isochrones( username TEXT, @@ -179,4 +179,4 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get TomTom isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.34.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.34.0.sql index 50df4f4..80b1900 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.34.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.34.0.sql @@ -66,7 +66,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate Mapbox routing') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_route_with_waypoints( username TEXT, @@ -127,7 +127,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate TomTom routing') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_route_with_waypoints( username TEXT, @@ -188,7 +188,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -228,7 +228,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_with_waypoints( @@ -267,7 +267,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- Get the connection to redis from cache or create a new one CREATE OR REPLACE FUNCTION cdb_dataservices_server._connect_to_redis(user_id text) RETURNS boolean AS $$ @@ -285,7 +285,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- -- Observatory connection config -- @@ -302,7 +302,7 @@ RETURNS text AS $$ user_obs_config = GD["user_obs_config_{0}".format(username)] return user_obs_config.connection_str -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshotJSON( username TEXT, @@ -356,7 +356,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshot( username TEXT, @@ -413,7 +413,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshotJSON( username TEXT, @@ -465,7 +465,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_segment_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshot( username TEXT, @@ -520,7 +520,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to OBS_GetSegmentSnapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasure( username TEXT, @@ -577,7 +577,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetCategory( username TEXT, @@ -632,7 +632,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusMeasure( username TEXT, @@ -689,7 +689,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetUSCensusMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusCategory( username TEXT, @@ -744,7 +744,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetUSCensusCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPopulation( username TEXT, @@ -799,7 +799,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetPopulation') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasureById( username TEXT, @@ -854,7 +854,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -915,7 +915,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomvals)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -976,7 +976,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomrefs)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeta( username TEXT, @@ -1024,7 +1024,7 @@ RETURNS JSON AS $$ import sys logger.error('Error trying to OBS_GetMeta', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_GetMeta') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_MetadataValidation( username TEXT, @@ -1070,7 +1070,7 @@ RETURNS TABLE(valid boolean, errors text[]) AS $$ import sys logger.error('Error trying to OBS_MetadataValidation', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_MetadataValidation') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_Search( username TEXT, orgname TEXT, @@ -1128,7 +1128,7 @@ RETURNS TABLE(id text, description text, name text, aggregate text, source text) raise Exception('Error trying to OBS_Search') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetAvailableBoundaries( username TEXT, @@ -1186,7 +1186,7 @@ RETURNS TABLE(boundary_id text, description text, time_span text, tablename text raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundary( username TEXT, orgname TEXT, @@ -1238,7 +1238,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundary') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryId( username TEXT, @@ -1291,7 +1291,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetBoundaryId') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryById( username TEXT, @@ -1344,7 +1344,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundaryById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByGeometry( username TEXT, @@ -1404,7 +1404,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByPointAndRadius( username TEXT, @@ -1466,7 +1466,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByGeometry( username TEXT, @@ -1526,7 +1526,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByPointAndRadius( username TEXT, @@ -1588,7 +1588,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE TYPE cdb_dataservices_server.ds_fdw_metadata as (schemaname text, tabname text, servername text); CREATE TYPE cdb_dataservices_server.ds_return_metadata as (colnames text[], coltypes text[]); @@ -1599,7 +1599,7 @@ RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ return plpy.execute("SELECT * FROM cdb_dataservices_server.__DST_ConnectUserTable({username}::text, {orgname}::text, {user_db_role}::text, {schema}::text, {dbname}::text, {host_addr}::text, {table_name}::text)" .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), user_db_role=plpy.quote_literal(user_db_role), schema=plpy.quote_literal(input_schema), dbname=plpy.quote_literal(dbname), table_name=plpy.quote_literal(table_name), host_addr=plpy.quote_literal(host_addr)) )[0] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.__DST_ConnectUserTable(username text, orgname text, user_db_role text, input_schema text, dbname text, host_addr text, table_name text) RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ @@ -1728,7 +1728,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1766,7 +1766,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1780,7 +1780,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1794,7 +1794,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1808,7 +1808,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1822,7 +1822,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_type inner join pg_namespace ON (pg_type.typnamespace = pg_namespace.oid) @@ -1931,7 +1931,7 @@ RETURNS SETOF cdb_dataservices_server.service_quota_info AS $$ ret += [[service, monthly_quota, used_quota, soft_limit, provider]] return ret -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_quota_info_batch( @@ -1961,7 +1961,7 @@ RETURNS SETOF cdb_dataservices_server.service_quota_info_batch AS $$ ret += [[info['service'], info['monthly_quota'], info['used_quota'], info['soft_limit'], info['provider'], info['max_batch_size']]] return ret -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_enough_quota( username TEXT, @@ -2013,7 +2013,7 @@ RETURNS Geometry AS $$ else: raise Exception('Requested geocoder is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) @@ -2029,7 +2029,7 @@ RETURNS Geometry AS $$ else: raise Exception('Here geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2044,7 +2044,7 @@ RETURNS Geometry AS $$ else: raise Exception('Google geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2057,7 +2057,7 @@ RETURNS Geometry AS $$ mapzen_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapzen_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapzen_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2070,7 +2070,7 @@ RETURNS Geometry AS $$ mapbox_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapbox_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapbox_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_tomtom_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2083,7 +2083,7 @@ RETURNS Geometry AS $$ tomtom_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_tomtom_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(tomtom_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2116,7 +2116,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using here maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2148,7 +2148,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using google maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2189,7 +2189,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapzen') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2235,7 +2235,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using Mapbox') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2281,7 +2281,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using TomTom') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_get_rate_limit( username TEXT, @@ -2300,7 +2300,7 @@ RETURNS JSON AS $$ return json.dumps({'limit': rate_limit_config.limit, 'period': rate_limit_config.period}) else: return None -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_user_rate_limit( username TEXT, @@ -2324,7 +2324,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_user_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_org_rate_limit( username TEXT, @@ -2348,7 +2348,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_org_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_server_rate_limit( username TEXT, @@ -2372,7 +2372,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_server_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; -- TODO: could cartodb_id be replaced by rowid, maybe needing extra care for offset? CREATE TYPE cdb_dataservices_server.geocoding AS ( cartodb_id integer, @@ -2412,7 +2412,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ plan = plpy.prepare("SELECT * FROM cdb_dataservices_server.{}($1, $2, $3); ".format(provider_function), ["text", "text", "jsonb"]) return plpy.execute(plan, [username, orgname, searches]) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_google_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2423,7 +2423,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = LegacyServiceManager('geocoder', username, orgname, GD) geocoder = GoogleMapsBulkGeocoder(service_manager.config.google_client_id, service_manager.config.google_api_key, service_manager.logger) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_heremaps_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2434,7 +2434,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = LegacyServiceManager('geocoder', username, orgname, GD) geocoder = HereMapsBulkGeocoder(service_manager.config.heremaps_app_id, service_manager.config.heremaps_app_code, service_manager.logger, service_manager.config.heremaps_service_params) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_tomtom_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2451,7 +2451,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = ServiceManager('geocoder', TomTomGeocoderConfigBuilder, username, orgname, GD) geocoder = TomTomBulkGeocoder(service_manager.config.tomtom_api_key, service_manager.logger, service_manager.config.service_params) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_mapbox_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2468,7 +2468,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = ServiceManager('geocoder', MapboxGeocoderConfigBuilder, username, orgname, GD) geocoder = MapboxBulkGeocoder(service_manager.config.mapbox_api_key, service_manager.logger, service_manager.config.service_params) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin0_polygon(username text, orgname text, country_name text) RETURNS Geometry AS $$ @@ -2507,7 +2507,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin0 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2566,7 +2566,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_admin1_polygon(admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin1_polygon(username text, orgname text, admin1_name text, country_name text) @@ -2604,7 +2604,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2677,7 +2677,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3) as point;", ["text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, country_name text) @@ -2697,7 +2697,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, NULL, $4) as point;", ["text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, admin1_name text, country_name text) @@ -2717,7 +2717,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, $4, $5) as point;", ["text", "text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, admin1_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_internal_geocode_namedplace(username text, orgname text, city_name text, admin1_name text DEFAULT NULL, country_name text DEFAULT NULL) RETURNS Geometry AS $$ @@ -2762,7 +2762,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode namedplace point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2869,7 +2869,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -2911,7 +2911,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -2953,7 +2953,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -2996,7 +2996,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -3135,7 +3135,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -3224,7 +3224,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isodistance( username TEXT, @@ -3290,7 +3290,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isodistance( username TEXT, @@ -3355,7 +3355,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_isodistance( username TEXT, @@ -3419,7 +3419,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get TomTom isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isochrones( username TEXT, @@ -3482,7 +3482,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isochrones( username TEXT, @@ -3543,7 +3543,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_isochrones( username TEXT, @@ -3603,7 +3603,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get TomTom isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -3637,7 +3637,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3652,7 +3652,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3666,7 +3666,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapbox isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3680,7 +3680,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- tomtom isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_tomtom_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3694,7 +3694,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -3728,7 +3728,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3743,7 +3743,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3756,7 +3756,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapzen_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapzen_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapbox isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3769,7 +3769,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapbox_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapbox_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- tomtom isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_tomtom_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3782,7 +3782,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ tomtom_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_tomtom_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; DO $$ BEGIN IF NOT EXISTS ( diff --git a/server/extension/old_versions/cdb_dataservices_server--0.34.1--0.34.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.34.1--0.34.0.sql index 4e19c56..248b962 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.34.1--0.34.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.34.1--0.34.0.sql @@ -64,7 +64,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isochrones( username TEXT, @@ -125,7 +125,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_isochrones( username TEXT, @@ -185,4 +185,4 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get TomTom isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.34.1--0.34.2.sql b/server/extension/old_versions/cdb_dataservices_server--0.34.1--0.34.2.sql index e94edee..5fd13f5 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.34.1--0.34.2.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.34.1--0.34.2.sql @@ -36,4 +36,4 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ plan = plpy.prepare("SELECT * FROM cdb_dataservices_server.{}($1, $2, $3); ".format(provider_function), ["text", "text", "jsonb"]) return plpy.execute(plan, [username, orgname, searches]) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.34.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.34.1.sql index 73a598f..8197024 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.34.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.34.1.sql @@ -66,7 +66,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate Mapbox routing') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_route_with_waypoints( username TEXT, @@ -127,7 +127,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate TomTom routing') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_route_with_waypoints( username TEXT, @@ -188,7 +188,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -228,7 +228,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_with_waypoints( @@ -267,7 +267,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- Get the connection to redis from cache or create a new one CREATE OR REPLACE FUNCTION cdb_dataservices_server._connect_to_redis(user_id text) RETURNS boolean AS $$ @@ -285,7 +285,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- -- Observatory connection config -- @@ -302,7 +302,7 @@ RETURNS text AS $$ user_obs_config = GD["user_obs_config_{0}".format(username)] return user_obs_config.connection_str -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshotJSON( username TEXT, @@ -356,7 +356,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshot( username TEXT, @@ -413,7 +413,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshotJSON( username TEXT, @@ -465,7 +465,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_segment_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshot( username TEXT, @@ -520,7 +520,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to OBS_GetSegmentSnapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasure( username TEXT, @@ -577,7 +577,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetCategory( username TEXT, @@ -632,7 +632,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusMeasure( username TEXT, @@ -689,7 +689,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetUSCensusMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusCategory( username TEXT, @@ -744,7 +744,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetUSCensusCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPopulation( username TEXT, @@ -799,7 +799,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetPopulation') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasureById( username TEXT, @@ -854,7 +854,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -915,7 +915,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomvals)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -976,7 +976,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomrefs)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeta( username TEXT, @@ -1024,7 +1024,7 @@ RETURNS JSON AS $$ import sys logger.error('Error trying to OBS_GetMeta', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_GetMeta') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_MetadataValidation( username TEXT, @@ -1070,7 +1070,7 @@ RETURNS TABLE(valid boolean, errors text[]) AS $$ import sys logger.error('Error trying to OBS_MetadataValidation', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_MetadataValidation') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_Search( username TEXT, orgname TEXT, @@ -1128,7 +1128,7 @@ RETURNS TABLE(id text, description text, name text, aggregate text, source text) raise Exception('Error trying to OBS_Search') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetAvailableBoundaries( username TEXT, @@ -1186,7 +1186,7 @@ RETURNS TABLE(boundary_id text, description text, time_span text, tablename text raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundary( username TEXT, orgname TEXT, @@ -1238,7 +1238,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundary') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryId( username TEXT, @@ -1291,7 +1291,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetBoundaryId') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryById( username TEXT, @@ -1344,7 +1344,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundaryById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByGeometry( username TEXT, @@ -1404,7 +1404,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByPointAndRadius( username TEXT, @@ -1466,7 +1466,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByGeometry( username TEXT, @@ -1526,7 +1526,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByPointAndRadius( username TEXT, @@ -1588,7 +1588,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE TYPE cdb_dataservices_server.ds_fdw_metadata as (schemaname text, tabname text, servername text); CREATE TYPE cdb_dataservices_server.ds_return_metadata as (colnames text[], coltypes text[]); @@ -1599,7 +1599,7 @@ RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ return plpy.execute("SELECT * FROM cdb_dataservices_server.__DST_ConnectUserTable({username}::text, {orgname}::text, {user_db_role}::text, {schema}::text, {dbname}::text, {host_addr}::text, {table_name}::text)" .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), user_db_role=plpy.quote_literal(user_db_role), schema=plpy.quote_literal(input_schema), dbname=plpy.quote_literal(dbname), table_name=plpy.quote_literal(table_name), host_addr=plpy.quote_literal(host_addr)) )[0] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.__DST_ConnectUserTable(username text, orgname text, user_db_role text, input_schema text, dbname text, host_addr text, table_name text) RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ @@ -1728,7 +1728,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1766,7 +1766,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1780,7 +1780,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1794,7 +1794,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1808,7 +1808,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1822,7 +1822,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_type inner join pg_namespace ON (pg_type.typnamespace = pg_namespace.oid) @@ -1931,7 +1931,7 @@ RETURNS SETOF cdb_dataservices_server.service_quota_info AS $$ ret += [[service, monthly_quota, used_quota, soft_limit, provider]] return ret -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_quota_info_batch( @@ -1961,7 +1961,7 @@ RETURNS SETOF cdb_dataservices_server.service_quota_info_batch AS $$ ret += [[info['service'], info['monthly_quota'], info['used_quota'], info['soft_limit'], info['provider'], info['max_batch_size']]] return ret -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_enough_quota( username TEXT, @@ -2013,7 +2013,7 @@ RETURNS Geometry AS $$ else: raise Exception('Requested geocoder is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) @@ -2029,7 +2029,7 @@ RETURNS Geometry AS $$ else: raise Exception('Here geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2044,7 +2044,7 @@ RETURNS Geometry AS $$ else: raise Exception('Google geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2057,7 +2057,7 @@ RETURNS Geometry AS $$ mapzen_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapzen_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapzen_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2070,7 +2070,7 @@ RETURNS Geometry AS $$ mapbox_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapbox_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapbox_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_tomtom_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2083,7 +2083,7 @@ RETURNS Geometry AS $$ tomtom_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_tomtom_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(tomtom_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2116,7 +2116,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using here maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2148,7 +2148,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using google maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2189,7 +2189,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapzen') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2235,7 +2235,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using Mapbox') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2281,7 +2281,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using TomTom') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_get_rate_limit( username TEXT, @@ -2300,7 +2300,7 @@ RETURNS JSON AS $$ return json.dumps({'limit': rate_limit_config.limit, 'period': rate_limit_config.period}) else: return None -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_user_rate_limit( username TEXT, @@ -2324,7 +2324,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_user_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_org_rate_limit( username TEXT, @@ -2348,7 +2348,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_org_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_server_rate_limit( username TEXT, @@ -2372,7 +2372,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_server_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; -- TODO: could cartodb_id be replaced by rowid, maybe needing extra care for offset? CREATE TYPE cdb_dataservices_server.geocoding AS ( cartodb_id integer, @@ -2412,7 +2412,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ plan = plpy.prepare("SELECT * FROM cdb_dataservices_server.{}($1, $2, $3); ".format(provider_function), ["text", "text", "jsonb"]) return plpy.execute(plan, [username, orgname, searches]) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_google_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2423,7 +2423,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = LegacyServiceManager('geocoder', username, orgname, GD) geocoder = GoogleMapsBulkGeocoder(service_manager.config.google_client_id, service_manager.config.google_api_key, service_manager.logger) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_heremaps_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2434,7 +2434,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = LegacyServiceManager('geocoder', username, orgname, GD) geocoder = HereMapsBulkGeocoder(service_manager.config.heremaps_app_id, service_manager.config.heremaps_app_code, service_manager.logger, service_manager.config.heremaps_service_params) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_tomtom_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2451,7 +2451,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = ServiceManager('geocoder', TomTomGeocoderConfigBuilder, username, orgname, GD) geocoder = TomTomBulkGeocoder(service_manager.config.tomtom_api_key, service_manager.logger, service_manager.config.service_params) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_mapbox_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2468,7 +2468,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = ServiceManager('geocoder', MapboxGeocoderConfigBuilder, username, orgname, GD) geocoder = MapboxBulkGeocoder(service_manager.config.mapbox_api_key, service_manager.logger, service_manager.config.service_params) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin0_polygon(username text, orgname text, country_name text) RETURNS Geometry AS $$ @@ -2507,7 +2507,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin0 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2566,7 +2566,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_admin1_polygon(admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin1_polygon(username text, orgname text, admin1_name text, country_name text) @@ -2604,7 +2604,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2677,7 +2677,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3) as point;", ["text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, country_name text) @@ -2697,7 +2697,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, NULL, $4) as point;", ["text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, admin1_name text, country_name text) @@ -2717,7 +2717,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, $4, $5) as point;", ["text", "text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, admin1_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_internal_geocode_namedplace(username text, orgname text, city_name text, admin1_name text DEFAULT NULL, country_name text DEFAULT NULL) RETURNS Geometry AS $$ @@ -2762,7 +2762,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode namedplace point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2869,7 +2869,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -2911,7 +2911,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -2953,7 +2953,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -2996,7 +2996,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -3135,7 +3135,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -3224,7 +3224,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isodistance( username TEXT, @@ -3290,7 +3290,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isodistance( username TEXT, @@ -3355,7 +3355,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_isodistance( username TEXT, @@ -3419,7 +3419,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get TomTom isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isochrones( username TEXT, @@ -3480,7 +3480,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isochrones( username TEXT, @@ -3539,7 +3539,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_isochrones( username TEXT, @@ -3597,7 +3597,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get TomTom isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -3631,7 +3631,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3646,7 +3646,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3660,7 +3660,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapbox isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3674,7 +3674,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- tomtom isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_tomtom_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3688,7 +3688,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -3722,7 +3722,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3737,7 +3737,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3750,7 +3750,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapzen_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapzen_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapbox isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3763,7 +3763,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapbox_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapbox_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- tomtom isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_tomtom_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3776,7 +3776,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ tomtom_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_tomtom_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; DO $$ BEGIN IF NOT EXISTS ( diff --git a/server/extension/old_versions/cdb_dataservices_server--0.34.2--0.34.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.34.2--0.34.1.sql index 12af1ed..8fd4d74 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.34.2--0.34.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.34.2--0.34.1.sql @@ -36,4 +36,4 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ plan = plpy.prepare("SELECT * FROM cdb_dataservices_server.{}($1, $2, $3); ".format(provider_function), ["text", "text", "jsonb"]) return plpy.execute(plan, [username, orgname, searches]) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.34.2--0.35.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.34.2--0.35.0.sql index 28893c4..5ae8a23 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.34.2--0.35.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.34.2--0.35.0.sql @@ -70,7 +70,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate Mapbox routing') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_route_with_waypoints( username TEXT, @@ -138,7 +138,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate TomTom routing') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, @@ -179,7 +179,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_with_waypoints( @@ -218,4 +218,4 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.34.2.sql b/server/extension/old_versions/cdb_dataservices_server--0.34.2.sql index dfdb5d7..453f310 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.34.2.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.34.2.sql @@ -66,7 +66,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate Mapbox routing') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_route_with_waypoints( username TEXT, @@ -127,7 +127,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate TomTom routing') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_route_with_waypoints( username TEXT, @@ -188,7 +188,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -228,7 +228,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_with_waypoints( @@ -267,7 +267,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- Get the connection to redis from cache or create a new one CREATE OR REPLACE FUNCTION cdb_dataservices_server._connect_to_redis(user_id text) RETURNS boolean AS $$ @@ -285,7 +285,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- -- Observatory connection config -- @@ -302,7 +302,7 @@ RETURNS text AS $$ user_obs_config = GD["user_obs_config_{0}".format(username)] return user_obs_config.connection_str -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshotJSON( username TEXT, @@ -356,7 +356,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshot( username TEXT, @@ -413,7 +413,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshotJSON( username TEXT, @@ -465,7 +465,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_segment_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshot( username TEXT, @@ -520,7 +520,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to OBS_GetSegmentSnapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasure( username TEXT, @@ -577,7 +577,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetCategory( username TEXT, @@ -632,7 +632,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusMeasure( username TEXT, @@ -689,7 +689,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetUSCensusMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusCategory( username TEXT, @@ -744,7 +744,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetUSCensusCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPopulation( username TEXT, @@ -799,7 +799,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetPopulation') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasureById( username TEXT, @@ -854,7 +854,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -915,7 +915,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomvals)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -976,7 +976,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomrefs)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeta( username TEXT, @@ -1024,7 +1024,7 @@ RETURNS JSON AS $$ import sys logger.error('Error trying to OBS_GetMeta', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_GetMeta') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_MetadataValidation( username TEXT, @@ -1070,7 +1070,7 @@ RETURNS TABLE(valid boolean, errors text[]) AS $$ import sys logger.error('Error trying to OBS_MetadataValidation', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_MetadataValidation') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_Search( username TEXT, orgname TEXT, @@ -1128,7 +1128,7 @@ RETURNS TABLE(id text, description text, name text, aggregate text, source text) raise Exception('Error trying to OBS_Search') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetAvailableBoundaries( username TEXT, @@ -1186,7 +1186,7 @@ RETURNS TABLE(boundary_id text, description text, time_span text, tablename text raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundary( username TEXT, orgname TEXT, @@ -1238,7 +1238,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundary') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryId( username TEXT, @@ -1291,7 +1291,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetBoundaryId') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryById( username TEXT, @@ -1344,7 +1344,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundaryById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByGeometry( username TEXT, @@ -1404,7 +1404,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByPointAndRadius( username TEXT, @@ -1466,7 +1466,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByGeometry( username TEXT, @@ -1526,7 +1526,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByPointAndRadius( username TEXT, @@ -1588,7 +1588,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE TYPE cdb_dataservices_server.ds_fdw_metadata as (schemaname text, tabname text, servername text); CREATE TYPE cdb_dataservices_server.ds_return_metadata as (colnames text[], coltypes text[]); @@ -1599,7 +1599,7 @@ RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ return plpy.execute("SELECT * FROM cdb_dataservices_server.__DST_ConnectUserTable({username}::text, {orgname}::text, {user_db_role}::text, {schema}::text, {dbname}::text, {host_addr}::text, {table_name}::text)" .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), user_db_role=plpy.quote_literal(user_db_role), schema=plpy.quote_literal(input_schema), dbname=plpy.quote_literal(dbname), table_name=plpy.quote_literal(table_name), host_addr=plpy.quote_literal(host_addr)) )[0] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.__DST_ConnectUserTable(username text, orgname text, user_db_role text, input_schema text, dbname text, host_addr text, table_name text) RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ @@ -1728,7 +1728,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1766,7 +1766,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1780,7 +1780,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1794,7 +1794,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1808,7 +1808,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1822,7 +1822,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_type inner join pg_namespace ON (pg_type.typnamespace = pg_namespace.oid) @@ -1931,7 +1931,7 @@ RETURNS SETOF cdb_dataservices_server.service_quota_info AS $$ ret += [[service, monthly_quota, used_quota, soft_limit, provider]] return ret -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_quota_info_batch( @@ -1961,7 +1961,7 @@ RETURNS SETOF cdb_dataservices_server.service_quota_info_batch AS $$ ret += [[info['service'], info['monthly_quota'], info['used_quota'], info['soft_limit'], info['provider'], info['max_batch_size']]] return ret -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_enough_quota( username TEXT, @@ -2013,7 +2013,7 @@ RETURNS Geometry AS $$ else: raise Exception('Requested geocoder is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) @@ -2029,7 +2029,7 @@ RETURNS Geometry AS $$ else: raise Exception('Here geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2044,7 +2044,7 @@ RETURNS Geometry AS $$ else: raise Exception('Google geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2057,7 +2057,7 @@ RETURNS Geometry AS $$ mapzen_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapzen_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapzen_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2070,7 +2070,7 @@ RETURNS Geometry AS $$ mapbox_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapbox_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapbox_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_tomtom_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2083,7 +2083,7 @@ RETURNS Geometry AS $$ tomtom_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_tomtom_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(tomtom_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2116,7 +2116,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using here maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2148,7 +2148,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using google maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2189,7 +2189,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapzen') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2235,7 +2235,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using Mapbox') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2281,7 +2281,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using TomTom') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_get_rate_limit( username TEXT, @@ -2300,7 +2300,7 @@ RETURNS JSON AS $$ return json.dumps({'limit': rate_limit_config.limit, 'period': rate_limit_config.period}) else: return None -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_user_rate_limit( username TEXT, @@ -2324,7 +2324,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_user_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_org_rate_limit( username TEXT, @@ -2348,7 +2348,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_org_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_server_rate_limit( username TEXT, @@ -2372,7 +2372,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_server_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; -- TODO: could cartodb_id be replaced by rowid, maybe needing extra care for offset? CREATE TYPE cdb_dataservices_server.geocoding AS ( cartodb_id integer, @@ -2413,7 +2413,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ plan = plpy.prepare("SELECT * FROM cdb_dataservices_server.{}($1, $2, $3); ".format(provider_function), ["text", "text", "jsonb"]) return plpy.execute(plan, [username, orgname, searches]) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_google_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2424,7 +2424,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = LegacyServiceManager('geocoder', username, orgname, GD) geocoder = GoogleMapsBulkGeocoder(service_manager.config.google_client_id, service_manager.config.google_api_key, service_manager.logger) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_heremaps_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2435,7 +2435,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = LegacyServiceManager('geocoder', username, orgname, GD) geocoder = HereMapsBulkGeocoder(service_manager.config.heremaps_app_id, service_manager.config.heremaps_app_code, service_manager.logger, service_manager.config.heremaps_service_params) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_tomtom_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2452,7 +2452,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = ServiceManager('geocoder', TomTomGeocoderConfigBuilder, username, orgname, GD) geocoder = TomTomBulkGeocoder(service_manager.config.tomtom_api_key, service_manager.logger, service_manager.config.service_params) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_mapbox_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2469,7 +2469,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = ServiceManager('geocoder', MapboxGeocoderConfigBuilder, username, orgname, GD) geocoder = MapboxBulkGeocoder(service_manager.config.mapbox_api_key, service_manager.logger, service_manager.config.service_params) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin0_polygon(username text, orgname text, country_name text) RETURNS Geometry AS $$ @@ -2508,7 +2508,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin0 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2567,7 +2567,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_admin1_polygon(admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin1_polygon(username text, orgname text, admin1_name text, country_name text) @@ -2605,7 +2605,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2678,7 +2678,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3) as point;", ["text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, country_name text) @@ -2698,7 +2698,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, NULL, $4) as point;", ["text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, admin1_name text, country_name text) @@ -2718,7 +2718,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, $4, $5) as point;", ["text", "text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, admin1_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_internal_geocode_namedplace(username text, orgname text, city_name text, admin1_name text DEFAULT NULL, country_name text DEFAULT NULL) RETURNS Geometry AS $$ @@ -2763,7 +2763,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode namedplace point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2870,7 +2870,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -2912,7 +2912,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -2954,7 +2954,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -2997,7 +2997,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -3136,7 +3136,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -3225,7 +3225,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isodistance( username TEXT, @@ -3291,7 +3291,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isodistance( username TEXT, @@ -3356,7 +3356,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_isodistance( username TEXT, @@ -3420,7 +3420,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get TomTom isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isochrones( username TEXT, @@ -3481,7 +3481,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isochrones( username TEXT, @@ -3540,7 +3540,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_isochrones( username TEXT, @@ -3598,7 +3598,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get TomTom isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -3632,7 +3632,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3647,7 +3647,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3661,7 +3661,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapbox isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3675,7 +3675,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- tomtom isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_tomtom_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3689,7 +3689,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -3723,7 +3723,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3738,7 +3738,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3751,7 +3751,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapzen_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapzen_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapbox isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3764,7 +3764,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapbox_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapbox_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- tomtom isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_tomtom_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3777,7 +3777,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ tomtom_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_tomtom_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; DO $$ BEGIN IF NOT EXISTS ( diff --git a/server/extension/old_versions/cdb_dataservices_server--0.35.0--0.34.2.sql b/server/extension/old_versions/cdb_dataservices_server--0.35.0--0.34.2.sql index 61ba329..bfbfae3 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.35.0--0.34.2.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.35.0--0.34.2.sql @@ -64,7 +64,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate Mapbox routing') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_route_with_waypoints( username TEXT, @@ -125,7 +125,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate TomTom routing') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( @@ -167,7 +167,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_with_waypoints( @@ -206,4 +206,4 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.35.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.35.0.sql index acc54d7..4314dbc 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.35.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.35.0.sql @@ -72,7 +72,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate Mapbox routing') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_route_with_waypoints( username TEXT, @@ -140,7 +140,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate TomTom routing') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_route_with_waypoints( username TEXT, @@ -201,7 +201,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -241,7 +241,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_with_waypoints( @@ -280,7 +280,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- Get the connection to redis from cache or create a new one CREATE OR REPLACE FUNCTION cdb_dataservices_server._connect_to_redis(user_id text) RETURNS boolean AS $$ @@ -298,7 +298,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- -- Observatory connection config -- @@ -315,7 +315,7 @@ RETURNS text AS $$ user_obs_config = GD["user_obs_config_{0}".format(username)] return user_obs_config.connection_str -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshotJSON( username TEXT, @@ -369,7 +369,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshot( username TEXT, @@ -426,7 +426,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshotJSON( username TEXT, @@ -478,7 +478,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_segment_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshot( username TEXT, @@ -533,7 +533,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to OBS_GetSegmentSnapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasure( username TEXT, @@ -590,7 +590,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetCategory( username TEXT, @@ -645,7 +645,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusMeasure( username TEXT, @@ -702,7 +702,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetUSCensusMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusCategory( username TEXT, @@ -757,7 +757,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetUSCensusCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPopulation( username TEXT, @@ -812,7 +812,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetPopulation') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasureById( username TEXT, @@ -867,7 +867,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -928,7 +928,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomvals)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -989,7 +989,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomrefs)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeta( username TEXT, @@ -1037,7 +1037,7 @@ RETURNS JSON AS $$ import sys logger.error('Error trying to OBS_GetMeta', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_GetMeta') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_MetadataValidation( username TEXT, @@ -1083,7 +1083,7 @@ RETURNS TABLE(valid boolean, errors text[]) AS $$ import sys logger.error('Error trying to OBS_MetadataValidation', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_MetadataValidation') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_Search( username TEXT, orgname TEXT, @@ -1141,7 +1141,7 @@ RETURNS TABLE(id text, description text, name text, aggregate text, source text) raise Exception('Error trying to OBS_Search') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetAvailableBoundaries( username TEXT, @@ -1199,7 +1199,7 @@ RETURNS TABLE(boundary_id text, description text, time_span text, tablename text raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundary( username TEXT, orgname TEXT, @@ -1251,7 +1251,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundary') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryId( username TEXT, @@ -1304,7 +1304,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetBoundaryId') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryById( username TEXT, @@ -1357,7 +1357,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundaryById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByGeometry( username TEXT, @@ -1417,7 +1417,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByPointAndRadius( username TEXT, @@ -1479,7 +1479,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByGeometry( username TEXT, @@ -1539,7 +1539,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByPointAndRadius( username TEXT, @@ -1601,7 +1601,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE TYPE cdb_dataservices_server.ds_fdw_metadata as (schemaname text, tabname text, servername text); CREATE TYPE cdb_dataservices_server.ds_return_metadata as (colnames text[], coltypes text[]); @@ -1612,7 +1612,7 @@ RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ return plpy.execute("SELECT * FROM cdb_dataservices_server.__DST_ConnectUserTable({username}::text, {orgname}::text, {user_db_role}::text, {schema}::text, {dbname}::text, {host_addr}::text, {table_name}::text)" .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), user_db_role=plpy.quote_literal(user_db_role), schema=plpy.quote_literal(input_schema), dbname=plpy.quote_literal(dbname), table_name=plpy.quote_literal(table_name), host_addr=plpy.quote_literal(host_addr)) )[0] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.__DST_ConnectUserTable(username text, orgname text, user_db_role text, input_schema text, dbname text, host_addr text, table_name text) RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ @@ -1741,7 +1741,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1779,7 +1779,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1793,7 +1793,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1807,7 +1807,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1821,7 +1821,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1835,7 +1835,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_type inner join pg_namespace ON (pg_type.typnamespace = pg_namespace.oid) @@ -1944,7 +1944,7 @@ RETURNS SETOF cdb_dataservices_server.service_quota_info AS $$ ret += [[service, monthly_quota, used_quota, soft_limit, provider]] return ret -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_quota_info_batch( @@ -1974,7 +1974,7 @@ RETURNS SETOF cdb_dataservices_server.service_quota_info_batch AS $$ ret += [[info['service'], info['monthly_quota'], info['used_quota'], info['soft_limit'], info['provider'], info['max_batch_size']]] return ret -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_enough_quota( username TEXT, @@ -2026,7 +2026,7 @@ RETURNS Geometry AS $$ else: raise Exception('Requested geocoder is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) @@ -2042,7 +2042,7 @@ RETURNS Geometry AS $$ else: raise Exception('Here geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2057,7 +2057,7 @@ RETURNS Geometry AS $$ else: raise Exception('Google geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2070,7 +2070,7 @@ RETURNS Geometry AS $$ mapzen_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapzen_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapzen_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2083,7 +2083,7 @@ RETURNS Geometry AS $$ mapbox_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapbox_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapbox_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_tomtom_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2096,7 +2096,7 @@ RETURNS Geometry AS $$ tomtom_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_tomtom_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(tomtom_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2129,7 +2129,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using here maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2161,7 +2161,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using google maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2202,7 +2202,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapzen') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2248,7 +2248,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using Mapbox') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2294,7 +2294,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using TomTom') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_get_rate_limit( username TEXT, @@ -2313,7 +2313,7 @@ RETURNS JSON AS $$ return json.dumps({'limit': rate_limit_config.limit, 'period': rate_limit_config.period}) else: return None -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_user_rate_limit( username TEXT, @@ -2337,7 +2337,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_user_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_org_rate_limit( username TEXT, @@ -2361,7 +2361,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_org_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_server_rate_limit( username TEXT, @@ -2385,7 +2385,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_server_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; -- TODO: could cartodb_id be replaced by rowid, maybe needing extra care for offset? CREATE TYPE cdb_dataservices_server.geocoding AS ( cartodb_id integer, @@ -2426,7 +2426,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ plan = plpy.prepare("SELECT * FROM cdb_dataservices_server.{}($1, $2, $3); ".format(provider_function), ["text", "text", "jsonb"]) return plpy.execute(plan, [username, orgname, searches]) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_google_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2437,7 +2437,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = LegacyServiceManager('geocoder', username, orgname, GD) geocoder = GoogleMapsBulkGeocoder(service_manager.config.google_client_id, service_manager.config.google_api_key, service_manager.logger) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_heremaps_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2448,7 +2448,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = LegacyServiceManager('geocoder', username, orgname, GD) geocoder = HereMapsBulkGeocoder(service_manager.config.heremaps_app_id, service_manager.config.heremaps_app_code, service_manager.logger, service_manager.config.heremaps_service_params) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_tomtom_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2465,7 +2465,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = ServiceManager('geocoder', TomTomGeocoderConfigBuilder, username, orgname, GD) geocoder = TomTomBulkGeocoder(service_manager.config.tomtom_api_key, service_manager.logger, service_manager.config.service_params) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_mapbox_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2482,7 +2482,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = ServiceManager('geocoder', MapboxGeocoderConfigBuilder, username, orgname, GD) geocoder = MapboxBulkGeocoder(service_manager.config.mapbox_api_key, service_manager.logger, service_manager.config.service_params) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin0_polygon(username text, orgname text, country_name text) RETURNS Geometry AS $$ @@ -2521,7 +2521,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin0 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2580,7 +2580,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_admin1_polygon(admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin1_polygon(username text, orgname text, admin1_name text, country_name text) @@ -2618,7 +2618,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2691,7 +2691,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3) as point;", ["text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, country_name text) @@ -2711,7 +2711,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, NULL, $4) as point;", ["text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, admin1_name text, country_name text) @@ -2731,7 +2731,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, $4, $5) as point;", ["text", "text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, admin1_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_internal_geocode_namedplace(username text, orgname text, city_name text, admin1_name text DEFAULT NULL, country_name text DEFAULT NULL) RETURNS Geometry AS $$ @@ -2776,7 +2776,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode namedplace point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2883,7 +2883,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -2925,7 +2925,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -2967,7 +2967,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -3010,7 +3010,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -3149,7 +3149,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -3238,7 +3238,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isodistance( username TEXT, @@ -3304,7 +3304,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isodistance( username TEXT, @@ -3369,7 +3369,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_isodistance( username TEXT, @@ -3433,7 +3433,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get TomTom isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isochrones( username TEXT, @@ -3494,7 +3494,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isochrones( username TEXT, @@ -3553,7 +3553,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_isochrones( username TEXT, @@ -3611,7 +3611,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get TomTom isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -3645,7 +3645,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3660,7 +3660,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3674,7 +3674,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapbox isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3688,7 +3688,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- tomtom isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_tomtom_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3702,7 +3702,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -3736,7 +3736,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3751,7 +3751,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3764,7 +3764,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapzen_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapzen_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapbox isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3777,7 +3777,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapbox_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapbox_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- tomtom isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_tomtom_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3790,7 +3790,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ tomtom_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_tomtom_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; DO $$ BEGIN IF NOT EXISTS ( diff --git a/server/extension/old_versions/cdb_dataservices_server--0.35.1--0.36.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.35.1--0.36.0.sql index 5055adc..00ebeee 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.35.1--0.36.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.35.1--0.36.0.sql @@ -38,7 +38,7 @@ RETURNS Geometry AS $$ else: raise Exception('Requested geocoder is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocodio_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) @@ -52,7 +52,7 @@ RETURNS Geometry AS $$ geocodio_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_geocodio_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(geocodio_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_geocodio_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) @@ -100,7 +100,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using Geocodio') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) @@ -138,7 +138,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ plan = plpy.prepare("SELECT * FROM cdb_dataservices_server.{}($1, $2, $3); ".format(provider_function), ["text", "text", "jsonb"]) return plpy.execute(plan, [username, orgname, searches]) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_geocodio_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) @@ -156,7 +156,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = ServiceManager('geocoder', GeocodioGeocoderConfigBuilder, username, orgname, GD) geocoder = GeocodioBulkGeocoder(service_manager.config.geocodio_api_key, service_manager.logger, service_manager.config.service_params) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin0_polygon(username text, orgname text, country_name text) RETURNS Geometry AS $$ from cartodb_services.metrics import QuotaService @@ -194,4 +194,4 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin0 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.35.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.35.1.sql index 8c41227..080e7c5 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.35.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.35.1.sql @@ -72,7 +72,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate Mapbox routing') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_route_with_waypoints( username TEXT, @@ -140,7 +140,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate TomTom routing') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_route_with_waypoints( username TEXT, @@ -201,7 +201,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -241,7 +241,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_with_waypoints( @@ -280,7 +280,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- Get the connection to redis from cache or create a new one CREATE OR REPLACE FUNCTION cdb_dataservices_server._connect_to_redis(user_id text) RETURNS boolean AS $$ @@ -298,7 +298,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- -- Observatory connection config -- @@ -315,7 +315,7 @@ RETURNS text AS $$ user_obs_config = GD["user_obs_config_{0}".format(username)] return user_obs_config.connection_str -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshotJSON( username TEXT, @@ -369,7 +369,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshot( username TEXT, @@ -426,7 +426,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshotJSON( username TEXT, @@ -478,7 +478,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_segment_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshot( username TEXT, @@ -533,7 +533,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to OBS_GetSegmentSnapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasure( username TEXT, @@ -590,7 +590,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetCategory( username TEXT, @@ -645,7 +645,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusMeasure( username TEXT, @@ -702,7 +702,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetUSCensusMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusCategory( username TEXT, @@ -757,7 +757,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetUSCensusCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPopulation( username TEXT, @@ -812,7 +812,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetPopulation') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasureById( username TEXT, @@ -867,7 +867,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -928,7 +928,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomvals)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -989,7 +989,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomrefs)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeta( username TEXT, @@ -1037,7 +1037,7 @@ RETURNS JSON AS $$ import sys logger.error('Error trying to OBS_GetMeta', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_GetMeta') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_MetadataValidation( username TEXT, @@ -1083,7 +1083,7 @@ RETURNS TABLE(valid boolean, errors text[]) AS $$ import sys logger.error('Error trying to OBS_MetadataValidation', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_MetadataValidation') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_Search( username TEXT, orgname TEXT, @@ -1141,7 +1141,7 @@ RETURNS TABLE(id text, description text, name text, aggregate text, source text) raise Exception('Error trying to OBS_Search') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetAvailableBoundaries( username TEXT, @@ -1199,7 +1199,7 @@ RETURNS TABLE(boundary_id text, description text, time_span text, tablename text raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundary( username TEXT, orgname TEXT, @@ -1251,7 +1251,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundary') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryId( username TEXT, @@ -1304,7 +1304,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetBoundaryId') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryById( username TEXT, @@ -1357,7 +1357,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundaryById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByGeometry( username TEXT, @@ -1417,7 +1417,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByPointAndRadius( username TEXT, @@ -1479,7 +1479,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByGeometry( username TEXT, @@ -1539,7 +1539,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByPointAndRadius( username TEXT, @@ -1601,7 +1601,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE TYPE cdb_dataservices_server.ds_fdw_metadata as (schemaname text, tabname text, servername text); CREATE TYPE cdb_dataservices_server.ds_return_metadata as (colnames text[], coltypes text[]); @@ -1612,7 +1612,7 @@ RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ return plpy.execute("SELECT * FROM cdb_dataservices_server.__DST_ConnectUserTable({username}::text, {orgname}::text, {user_db_role}::text, {schema}::text, {dbname}::text, {host_addr}::text, {table_name}::text)" .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), user_db_role=plpy.quote_literal(user_db_role), schema=plpy.quote_literal(input_schema), dbname=plpy.quote_literal(dbname), table_name=plpy.quote_literal(table_name), host_addr=plpy.quote_literal(host_addr)) )[0] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.__DST_ConnectUserTable(username text, orgname text, user_db_role text, input_schema text, dbname text, host_addr text, table_name text) RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ @@ -1741,7 +1741,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1779,7 +1779,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1793,7 +1793,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1807,7 +1807,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1821,7 +1821,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1835,7 +1835,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_type inner join pg_namespace ON (pg_type.typnamespace = pg_namespace.oid) @@ -1944,7 +1944,7 @@ RETURNS SETOF cdb_dataservices_server.service_quota_info AS $$ ret += [[service, monthly_quota, used_quota, soft_limit, provider]] return ret -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_quota_info_batch( @@ -1974,7 +1974,7 @@ RETURNS SETOF cdb_dataservices_server.service_quota_info_batch AS $$ ret += [[info['service'], info['monthly_quota'], info['used_quota'], info['soft_limit'], info['provider'], info['max_batch_size']]] return ret -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_enough_quota( username TEXT, @@ -2026,7 +2026,7 @@ RETURNS Geometry AS $$ else: raise Exception('Requested geocoder is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) @@ -2042,7 +2042,7 @@ RETURNS Geometry AS $$ else: raise Exception('Here geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2057,7 +2057,7 @@ RETURNS Geometry AS $$ else: raise Exception('Google geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2070,7 +2070,7 @@ RETURNS Geometry AS $$ mapzen_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapzen_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapzen_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2083,7 +2083,7 @@ RETURNS Geometry AS $$ mapbox_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapbox_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapbox_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_tomtom_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2096,7 +2096,7 @@ RETURNS Geometry AS $$ tomtom_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_tomtom_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(tomtom_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2129,7 +2129,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using here maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2161,7 +2161,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using google maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2202,7 +2202,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapzen') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2248,7 +2248,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using Mapbox') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2294,7 +2294,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using TomTom') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_get_rate_limit( username TEXT, @@ -2313,7 +2313,7 @@ RETURNS JSON AS $$ return json.dumps({'limit': rate_limit_config.limit, 'period': rate_limit_config.period}) else: return None -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_user_rate_limit( username TEXT, @@ -2337,7 +2337,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_user_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_org_rate_limit( username TEXT, @@ -2361,7 +2361,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_org_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_server_rate_limit( username TEXT, @@ -2385,7 +2385,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_server_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; -- TODO: could cartodb_id be replaced by rowid, maybe needing extra care for offset? CREATE TYPE cdb_dataservices_server.geocoding AS ( cartodb_id integer, @@ -2426,7 +2426,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ plan = plpy.prepare("SELECT * FROM cdb_dataservices_server.{}($1, $2, $3); ".format(provider_function), ["text", "text", "jsonb"]) return plpy.execute(plan, [username, orgname, searches]) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_google_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2437,7 +2437,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = LegacyServiceManager('geocoder', username, orgname, GD) geocoder = GoogleMapsBulkGeocoder(service_manager.config.google_client_id, service_manager.config.google_api_key, service_manager.logger) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_heremaps_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2448,7 +2448,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = LegacyServiceManager('geocoder', username, orgname, GD) geocoder = HereMapsBulkGeocoder(service_manager.config.heremaps_app_id, service_manager.config.heremaps_app_code, service_manager.logger, service_manager.config.heremaps_service_params) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_tomtom_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2465,7 +2465,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = ServiceManager('geocoder', TomTomGeocoderConfigBuilder, username, orgname, GD) geocoder = TomTomBulkGeocoder(service_manager.config.tomtom_api_key, service_manager.logger, service_manager.config.service_params) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_mapbox_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2482,7 +2482,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = ServiceManager('geocoder', MapboxGeocoderConfigBuilder, username, orgname, GD) geocoder = MapboxBulkGeocoder(service_manager.config.mapbox_api_key, service_manager.logger, service_manager.config.service_params) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin0_polygon(username text, orgname text, country_name text) RETURNS Geometry AS $$ @@ -2521,7 +2521,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin0 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2580,7 +2580,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_admin1_polygon(admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin1_polygon(username text, orgname text, admin1_name text, country_name text) @@ -2618,7 +2618,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2691,7 +2691,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3) as point;", ["text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, country_name text) @@ -2711,7 +2711,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, NULL, $4) as point;", ["text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, admin1_name text, country_name text) @@ -2731,7 +2731,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, $4, $5) as point;", ["text", "text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, admin1_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_internal_geocode_namedplace(username text, orgname text, city_name text, admin1_name text DEFAULT NULL, country_name text DEFAULT NULL) RETURNS Geometry AS $$ @@ -2776,7 +2776,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode namedplace point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2883,7 +2883,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -2925,7 +2925,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -2967,7 +2967,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -3010,7 +3010,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -3149,7 +3149,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -3238,7 +3238,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isodistance( username TEXT, @@ -3304,7 +3304,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isodistance( username TEXT, @@ -3369,7 +3369,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_isodistance( username TEXT, @@ -3433,7 +3433,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get TomTom isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isochrones( username TEXT, @@ -3494,7 +3494,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isochrones( username TEXT, @@ -3553,7 +3553,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_isochrones( username TEXT, @@ -3611,7 +3611,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get TomTom isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -3645,7 +3645,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3660,7 +3660,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3674,7 +3674,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapbox isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3688,7 +3688,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- tomtom isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_tomtom_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3702,7 +3702,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -3736,7 +3736,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3751,7 +3751,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3764,7 +3764,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapzen_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapzen_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapbox isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3777,7 +3777,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapbox_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapbox_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- tomtom isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_tomtom_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3790,7 +3790,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ tomtom_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_tomtom_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; DO $$ BEGIN IF NOT EXISTS ( diff --git a/server/extension/old_versions/cdb_dataservices_server--0.36.0--0.35.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.36.0--0.35.1.sql index b9f5277..843776c 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.36.0--0.35.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.36.0--0.35.1.sql @@ -35,7 +35,7 @@ RETURNS Geometry AS $$ else: raise Exception('Requested geocoder is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; DROP FUNCTION IF EXISTS cdb_dataservices_server.cdb_geocodio_geocode_street_point; @@ -74,6 +74,6 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ plan = plpy.prepare("SELECT * FROM cdb_dataservices_server.{}($1, $2, $3); ".format(provider_function), ["text", "text", "jsonb"]) return plpy.execute(plan, [username, orgname, searches]) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; DROP FUNCTION IF EXISTS cdb_dataservices_server._cdb_bulk_geocodio_geocode_street_point; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.36.0--0.37.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.36.0--0.37.0.sql index c8c3676..43609ac 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.36.0--0.37.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.36.0--0.37.0.sql @@ -65,7 +65,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isochrones( username TEXT, @@ -123,4 +123,4 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.36.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.36.0.sql index 7e34397..c843256 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.36.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.36.0.sql @@ -72,7 +72,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate Mapbox routing') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_route_with_waypoints( username TEXT, @@ -140,7 +140,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate TomTom routing') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_route_with_waypoints( username TEXT, @@ -201,7 +201,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -241,7 +241,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_with_waypoints( @@ -280,7 +280,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- Get the connection to redis from cache or create a new one CREATE OR REPLACE FUNCTION cdb_dataservices_server._connect_to_redis(user_id text) RETURNS boolean AS $$ @@ -298,7 +298,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- -- Observatory connection config -- @@ -315,7 +315,7 @@ RETURNS text AS $$ user_obs_config = GD["user_obs_config_{0}".format(username)] return user_obs_config.connection_str -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshotJSON( username TEXT, @@ -369,7 +369,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshot( username TEXT, @@ -426,7 +426,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshotJSON( username TEXT, @@ -478,7 +478,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_segment_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshot( username TEXT, @@ -533,7 +533,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to OBS_GetSegmentSnapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasure( username TEXT, @@ -590,7 +590,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetCategory( username TEXT, @@ -645,7 +645,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusMeasure( username TEXT, @@ -702,7 +702,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetUSCensusMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusCategory( username TEXT, @@ -757,7 +757,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetUSCensusCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPopulation( username TEXT, @@ -812,7 +812,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetPopulation') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasureById( username TEXT, @@ -867,7 +867,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -928,7 +928,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomvals)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -989,7 +989,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomrefs)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeta( username TEXT, @@ -1037,7 +1037,7 @@ RETURNS JSON AS $$ import sys logger.error('Error trying to OBS_GetMeta', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_GetMeta') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_MetadataValidation( username TEXT, @@ -1083,7 +1083,7 @@ RETURNS TABLE(valid boolean, errors text[]) AS $$ import sys logger.error('Error trying to OBS_MetadataValidation', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_MetadataValidation') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_Search( username TEXT, orgname TEXT, @@ -1141,7 +1141,7 @@ RETURNS TABLE(id text, description text, name text, aggregate text, source text) raise Exception('Error trying to OBS_Search') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetAvailableBoundaries( username TEXT, @@ -1199,7 +1199,7 @@ RETURNS TABLE(boundary_id text, description text, time_span text, tablename text raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundary( username TEXT, orgname TEXT, @@ -1251,7 +1251,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundary') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryId( username TEXT, @@ -1304,7 +1304,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetBoundaryId') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryById( username TEXT, @@ -1357,7 +1357,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundaryById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByGeometry( username TEXT, @@ -1417,7 +1417,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByPointAndRadius( username TEXT, @@ -1479,7 +1479,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByGeometry( username TEXT, @@ -1539,7 +1539,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByPointAndRadius( username TEXT, @@ -1601,7 +1601,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE TYPE cdb_dataservices_server.ds_fdw_metadata as (schemaname text, tabname text, servername text); CREATE TYPE cdb_dataservices_server.ds_return_metadata as (colnames text[], coltypes text[]); @@ -1612,7 +1612,7 @@ RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ return plpy.execute("SELECT * FROM cdb_dataservices_server.__DST_ConnectUserTable({username}::text, {orgname}::text, {user_db_role}::text, {schema}::text, {dbname}::text, {host_addr}::text, {table_name}::text)" .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), user_db_role=plpy.quote_literal(user_db_role), schema=plpy.quote_literal(input_schema), dbname=plpy.quote_literal(dbname), table_name=plpy.quote_literal(table_name), host_addr=plpy.quote_literal(host_addr)) )[0] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.__DST_ConnectUserTable(username text, orgname text, user_db_role text, input_schema text, dbname text, host_addr text, table_name text) RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ @@ -1741,7 +1741,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1779,7 +1779,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1793,7 +1793,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1807,7 +1807,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1821,7 +1821,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1835,7 +1835,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_type inner join pg_namespace ON (pg_type.typnamespace = pg_namespace.oid) @@ -1944,7 +1944,7 @@ RETURNS SETOF cdb_dataservices_server.service_quota_info AS $$ ret += [[service, monthly_quota, used_quota, soft_limit, provider]] return ret -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_quota_info_batch( @@ -1974,7 +1974,7 @@ RETURNS SETOF cdb_dataservices_server.service_quota_info_batch AS $$ ret += [[info['service'], info['monthly_quota'], info['used_quota'], info['soft_limit'], info['provider'], info['max_batch_size']]] return ret -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_enough_quota( username TEXT, @@ -2029,7 +2029,7 @@ RETURNS Geometry AS $$ else: raise Exception('Requested geocoder is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) @@ -2045,7 +2045,7 @@ RETURNS Geometry AS $$ else: raise Exception('Here geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2060,7 +2060,7 @@ RETURNS Geometry AS $$ else: raise Exception('Google geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2073,7 +2073,7 @@ RETURNS Geometry AS $$ mapzen_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapzen_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapzen_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2086,7 +2086,7 @@ RETURNS Geometry AS $$ mapbox_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapbox_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapbox_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_tomtom_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2099,7 +2099,7 @@ RETURNS Geometry AS $$ tomtom_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_tomtom_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(tomtom_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocodio_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2112,7 +2112,7 @@ RETURNS Geometry AS $$ geocodio_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_geocodio_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(geocodio_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2145,7 +2145,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using here maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2177,7 +2177,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using google maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2218,7 +2218,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapzen') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2264,7 +2264,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using Mapbox') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2310,7 +2310,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using TomTom') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_geocodio_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2356,7 +2356,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using Geocodio') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_get_rate_limit( username TEXT, @@ -2375,7 +2375,7 @@ RETURNS JSON AS $$ return json.dumps({'limit': rate_limit_config.limit, 'period': rate_limit_config.period}) else: return None -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_user_rate_limit( username TEXT, @@ -2399,7 +2399,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_user_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_org_rate_limit( username TEXT, @@ -2423,7 +2423,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_org_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_server_rate_limit( username TEXT, @@ -2447,7 +2447,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_server_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; -- TODO: could cartodb_id be replaced by rowid, maybe needing extra care for offset? CREATE TYPE cdb_dataservices_server.geocoding AS ( cartodb_id integer, @@ -2490,7 +2490,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ plan = plpy.prepare("SELECT * FROM cdb_dataservices_server.{}($1, $2, $3); ".format(provider_function), ["text", "text", "jsonb"]) return plpy.execute(plan, [username, orgname, searches]) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_google_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2501,7 +2501,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = LegacyServiceManager('geocoder', username, orgname, GD) geocoder = GoogleMapsBulkGeocoder(service_manager.config.google_client_id, service_manager.config.google_api_key, service_manager.logger) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_heremaps_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2512,7 +2512,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = LegacyServiceManager('geocoder', username, orgname, GD) geocoder = HereMapsBulkGeocoder(service_manager.config.heremaps_app_id, service_manager.config.heremaps_app_code, service_manager.logger, service_manager.config.heremaps_service_params) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_tomtom_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2529,7 +2529,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = ServiceManager('geocoder', TomTomGeocoderConfigBuilder, username, orgname, GD) geocoder = TomTomBulkGeocoder(service_manager.config.tomtom_api_key, service_manager.logger, service_manager.config.service_params) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_mapbox_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2546,7 +2546,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = ServiceManager('geocoder', MapboxGeocoderConfigBuilder, username, orgname, GD) geocoder = MapboxBulkGeocoder(service_manager.config.mapbox_api_key, service_manager.logger, service_manager.config.service_params) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_geocodio_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2563,7 +2563,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = ServiceManager('geocoder', GeocodioGeocoderConfigBuilder, username, orgname, GD) geocoder = GeocodioBulkGeocoder(service_manager.config.geocodio_api_key, service_manager.logger, service_manager.config.service_params) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin0_polygon(username text, orgname text, country_name text) RETURNS Geometry AS $$ from cartodb_services.metrics import QuotaService @@ -2601,7 +2601,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin0 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2660,7 +2660,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_admin1_polygon(admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin1_polygon(username text, orgname text, admin1_name text, country_name text) @@ -2698,7 +2698,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2771,7 +2771,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3) as point;", ["text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, country_name text) @@ -2791,7 +2791,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, NULL, $4) as point;", ["text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, admin1_name text, country_name text) @@ -2811,7 +2811,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, $4, $5) as point;", ["text", "text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, admin1_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_internal_geocode_namedplace(username text, orgname text, city_name text, admin1_name text DEFAULT NULL, country_name text DEFAULT NULL) RETURNS Geometry AS $$ @@ -2856,7 +2856,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode namedplace point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2963,7 +2963,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -3005,7 +3005,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -3047,7 +3047,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -3090,7 +3090,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -3229,7 +3229,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -3318,7 +3318,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isodistance( username TEXT, @@ -3384,7 +3384,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isodistance( username TEXT, @@ -3449,7 +3449,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_isodistance( username TEXT, @@ -3513,7 +3513,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get TomTom isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isochrones( username TEXT, @@ -3574,7 +3574,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isochrones( username TEXT, @@ -3633,7 +3633,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_isochrones( username TEXT, @@ -3691,7 +3691,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get TomTom isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -3725,7 +3725,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3740,7 +3740,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3754,7 +3754,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapbox isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3768,7 +3768,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- tomtom isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_tomtom_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3782,7 +3782,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -3816,7 +3816,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3831,7 +3831,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3844,7 +3844,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapzen_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapzen_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapbox isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3857,7 +3857,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapbox_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapbox_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- tomtom isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_tomtom_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3870,7 +3870,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ tomtom_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_tomtom_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; DO $$ BEGIN IF NOT EXISTS ( diff --git a/server/extension/old_versions/cdb_dataservices_server--0.37.0--0.36.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.37.0--0.36.0.sql index dd14b81..3124830 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.37.0--0.36.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.37.0--0.36.0.sql @@ -66,7 +66,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isochrones( @@ -126,4 +126,4 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.37.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.37.0.sql index 7f46089..b8fb460 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.37.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.37.0.sql @@ -72,7 +72,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate Mapbox routing') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_route_with_waypoints( username TEXT, @@ -140,7 +140,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate TomTom routing') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_route_with_waypoints( username TEXT, @@ -201,7 +201,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ raise Exception('Error trying to calculate mapzen routing') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -241,7 +241,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_with_waypoints( @@ -280,7 +280,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ return [result[0]['shape'],result[0]['length'], result[0]['duration']] else: raise Exception('Requested routing method is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- Get the connection to redis from cache or create a new one CREATE OR REPLACE FUNCTION cdb_dataservices_server._connect_to_redis(user_id text) RETURNS boolean AS $$ @@ -298,7 +298,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- -- Observatory connection config -- @@ -315,7 +315,7 @@ RETURNS text AS $$ user_obs_config = GD["user_obs_config_{0}".format(username)] return user_obs_config.connection_str -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshotJSON( username TEXT, @@ -369,7 +369,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshot( username TEXT, @@ -426,7 +426,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to obs_get_demographic_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshotJSON( username TEXT, @@ -478,7 +478,7 @@ RETURNS json AS $$ raise Exception('Error trying to obs_get_segment_snapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshot( username TEXT, @@ -533,7 +533,7 @@ RETURNS SETOF JSON AS $$ raise Exception('Error trying to OBS_GetSegmentSnapshot') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasure( username TEXT, @@ -590,7 +590,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetCategory( username TEXT, @@ -645,7 +645,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusMeasure( username TEXT, @@ -702,7 +702,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetUSCensusMeasure') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusCategory( username TEXT, @@ -757,7 +757,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetUSCensusCategory') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPopulation( username TEXT, @@ -812,7 +812,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetPopulation') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasureById( username TEXT, @@ -867,7 +867,7 @@ RETURNS NUMERIC AS $$ raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -928,7 +928,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomvals)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetData( username TEXT, @@ -989,7 +989,7 @@ RETURNS TABLE ( raise Exception('Error trying to OBS_GetData') finally: quota_service.increment_total_service_use(len(geomrefs)) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeta( username TEXT, @@ -1037,7 +1037,7 @@ RETURNS JSON AS $$ import sys logger.error('Error trying to OBS_GetMeta', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_GetMeta') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_MetadataValidation( username TEXT, @@ -1083,7 +1083,7 @@ RETURNS TABLE(valid boolean, errors text[]) AS $$ import sys logger.error('Error trying to OBS_MetadataValidation', sys.exc_info(), data={"username": username, "orgname": orgname}) raise Exception('Error trying to OBS_MetadataValidation') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_Search( username TEXT, orgname TEXT, @@ -1141,7 +1141,7 @@ RETURNS TABLE(id text, description text, name text, aggregate text, source text) raise Exception('Error trying to OBS_Search') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetAvailableBoundaries( username TEXT, @@ -1199,7 +1199,7 @@ RETURNS TABLE(boundary_id text, description text, time_span text, tablename text raise Exception('Error trying to OBS_GetMeasureById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundary( username TEXT, orgname TEXT, @@ -1251,7 +1251,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundary') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryId( username TEXT, @@ -1304,7 +1304,7 @@ RETURNS TEXT AS $$ raise Exception('Error trying to OBS_GetBoundaryId') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundaryById( username TEXT, @@ -1357,7 +1357,7 @@ RETURNS geometry(Geometry, 4326) AS $$ raise Exception('Error trying to OBS_GetBoundaryById') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByGeometry( username TEXT, @@ -1417,7 +1417,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetBoundariesByPointAndRadius( username TEXT, @@ -1479,7 +1479,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetBoundariesByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByGeometry( username TEXT, @@ -1539,7 +1539,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByGeometry') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPointsByPointAndRadius( username TEXT, @@ -1601,7 +1601,7 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$ raise Exception('Error trying to OBS_GetPointsByPointAndRadius') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE TYPE cdb_dataservices_server.ds_fdw_metadata as (schemaname text, tabname text, servername text); CREATE TYPE cdb_dataservices_server.ds_return_metadata as (colnames text[], coltypes text[]); @@ -1612,7 +1612,7 @@ RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ return plpy.execute("SELECT * FROM cdb_dataservices_server.__DST_ConnectUserTable({username}::text, {orgname}::text, {user_db_role}::text, {schema}::text, {dbname}::text, {host_addr}::text, {table_name}::text)" .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), user_db_role=plpy.quote_literal(user_db_role), schema=plpy.quote_literal(input_schema), dbname=plpy.quote_literal(dbname), table_name=plpy.quote_literal(table_name), host_addr=plpy.quote_literal(host_addr)) )[0] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.__DST_ConnectUserTable(username text, orgname text, user_db_role text, input_schema text, dbname text, host_addr text, table_name text) RETURNS cdb_dataservices_server.ds_fdw_metadata AS $$ @@ -1741,7 +1741,7 @@ RETURNS boolean AS $$ logger_config = LoggerConfig(plpy) GD[cache_key] = logger_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; -- This is done in order to avoid an undesired depedency on cartodb extension CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_conf_getconf(input_key text) @@ -1779,7 +1779,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname, provider) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1793,7 +1793,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1807,7 +1807,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1821,7 +1821,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1835,7 +1835,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_type inner join pg_namespace ON (pg_type.typnamespace = pg_namespace.oid) @@ -1944,7 +1944,7 @@ RETURNS SETOF cdb_dataservices_server.service_quota_info AS $$ ret += [[service, monthly_quota, used_quota, soft_limit, provider]] return ret -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_quota_info_batch( @@ -1974,7 +1974,7 @@ RETURNS SETOF cdb_dataservices_server.service_quota_info_batch AS $$ ret += [[info['service'], info['monthly_quota'], info['used_quota'], info['soft_limit'], info['provider'], info['max_batch_size']]] return ret -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_enough_quota( username TEXT, @@ -2029,7 +2029,7 @@ RETURNS Geometry AS $$ else: raise Exception('Requested geocoder is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) @@ -2045,7 +2045,7 @@ RETURNS Geometry AS $$ else: raise Exception('Here geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2060,7 +2060,7 @@ RETURNS Geometry AS $$ else: raise Exception('Google geocoder is not available for your account.') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2073,7 +2073,7 @@ RETURNS Geometry AS $$ mapzen_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapzen_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapzen_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2086,7 +2086,7 @@ RETURNS Geometry AS $$ mapbox_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapbox_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(mapbox_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_tomtom_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2099,7 +2099,7 @@ RETURNS Geometry AS $$ tomtom_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_tomtom_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(tomtom_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocodio_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2112,7 +2112,7 @@ RETURNS Geometry AS $$ geocodio_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_geocodio_geocode_street_point($1, $2, $3, $4, $5, $6) as point; ", ["text", "text", "text", "text", "text", "text"]) return plpy.execute(geocodio_plan, [username, orgname, searchtext, city, state_province, country], 1)[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2145,7 +2145,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using here maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_google_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2177,7 +2177,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using google maps') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2218,7 +2218,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using mapzen') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2264,7 +2264,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using Mapbox') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2310,7 +2310,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using TomTom') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_geocodio_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -2356,7 +2356,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode street point using Geocodio') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_get_rate_limit( username TEXT, @@ -2375,7 +2375,7 @@ RETURNS JSON AS $$ return json.dumps({'limit': rate_limit_config.limit, 'period': rate_limit_config.period}) else: return None -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_user_rate_limit( username TEXT, @@ -2399,7 +2399,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_user_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_org_rate_limit( username TEXT, @@ -2423,7 +2423,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_org_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_server_rate_limit( username TEXT, @@ -2447,7 +2447,7 @@ RETURNS VOID AS $$ period = None config = RateLimitsConfig(service=service, username=username, limit=limit, period=period) config_setter.set_server_rate_limits(config) -$$ LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE; +$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; -- TODO: could cartodb_id be replaced by rowid, maybe needing extra care for offset? CREATE TYPE cdb_dataservices_server.geocoding AS ( cartodb_id integer, @@ -2490,7 +2490,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ plan = plpy.prepare("SELECT * FROM cdb_dataservices_server.{}($1, $2, $3); ".format(provider_function), ["text", "text", "jsonb"]) return plpy.execute(plan, [username, orgname, searches]) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_google_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2501,7 +2501,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = LegacyServiceManager('geocoder', username, orgname, GD) geocoder = GoogleMapsBulkGeocoder(service_manager.config.google_client_id, service_manager.config.google_api_key, service_manager.logger) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_heremaps_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2512,7 +2512,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = LegacyServiceManager('geocoder', username, orgname, GD) geocoder = HereMapsBulkGeocoder(service_manager.config.heremaps_app_id, service_manager.config.heremaps_app_code, service_manager.logger, service_manager.config.heremaps_service_params) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_tomtom_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2529,7 +2529,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = ServiceManager('geocoder', TomTomGeocoderConfigBuilder, username, orgname, GD) geocoder = TomTomBulkGeocoder(service_manager.config.tomtom_api_key, service_manager.logger, service_manager.config.service_params) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_mapbox_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2546,7 +2546,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = ServiceManager('geocoder', MapboxGeocoderConfigBuilder, username, orgname, GD) geocoder = MapboxBulkGeocoder(service_manager.config.mapbox_api_key, service_manager.logger, service_manager.config.service_params) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_geocodio_geocode_street_point(username TEXT, orgname TEXT, searches jsonb) RETURNS SETOF cdb_dataservices_server.geocoding AS $$ @@ -2563,7 +2563,7 @@ RETURNS SETOF cdb_dataservices_server.geocoding AS $$ service_manager = ServiceManager('geocoder', GeocodioGeocoderConfigBuilder, username, orgname, GD) geocoder = GeocodioBulkGeocoder(service_manager.config.geocodio_api_key, service_manager.logger, service_manager.config.service_params) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin0_polygon(username text, orgname text, country_name text) RETURNS Geometry AS $$ from cartodb_services.metrics import QuotaService @@ -2601,7 +2601,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin0 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2660,7 +2660,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_admin1_polygon(admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin1_polygon(username text, orgname text, admin1_name text, country_name text) @@ -2698,7 +2698,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode admin1 polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2771,7 +2771,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3) as point;", ["text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, country_name text) @@ -2791,7 +2791,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, NULL, $4) as point;", ["text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; ---- cdb_geocode_namedplace_point(city_name text, admin1_name text, country_name text) CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, admin1_name text, country_name text) @@ -2811,7 +2811,7 @@ RETURNS Geometry AS $$ logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname}) internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, $4, $5) as point;", ["text", "text", "text", "text", "text"]) return plpy.execute(internal_plan, [username, orgname, city_name, admin1_name, country_name])[0]['point'] -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_internal_geocode_namedplace(username text, orgname text, city_name text, admin1_name text DEFAULT NULL, country_name text DEFAULT NULL) RETURNS Geometry AS $$ @@ -2856,7 +2856,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode namedplace point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -2963,7 +2963,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -3005,7 +3005,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code point') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -3047,7 +3047,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision) RETURNS Geometry AS $$ @@ -3090,7 +3090,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code double precision, country text) RETURNS Geometry AS $$ @@ -3229,7 +3229,7 @@ RETURNS Geometry AS $$ raise Exception('Error trying to geocode postal code polygon') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -------------------------------------------------------------------------------- @@ -3318,7 +3318,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isodistance( username TEXT, @@ -3384,7 +3384,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isolines') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isodistance( username TEXT, @@ -3448,7 +3448,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_isodistance( username TEXT, @@ -3512,7 +3512,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get TomTom isolines') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_isochrones( username TEXT, @@ -3573,7 +3573,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get mapzen isochrones') finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapbox_isochrones( username TEXT, @@ -3631,7 +3631,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get Mapbox isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_tomtom_isochrones( username TEXT, @@ -3689,7 +3689,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ raise Exception('Error trying to get TomTom isochrones') finally: service_manager.quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu SECURITY DEFINER STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -3723,7 +3723,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3738,7 +3738,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3752,7 +3752,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapbox isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3766,7 +3766,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- tomtom isodistance CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_tomtom_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3780,7 +3780,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ from cartodb_services.metrics import metrics @@ -3814,7 +3814,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ return plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- heremaps isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_here_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3829,7 +3829,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ result = plpy.execute(here_plan, [username, orgname, type, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapzen isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapzen_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3842,7 +3842,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapzen_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapzen_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- mapbox isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_mapbox_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3855,7 +3855,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ mapbox_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_mapbox_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; -- tomtom isochrone CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_tomtom_isochrone(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) @@ -3868,7 +3868,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ tomtom_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server._cdb_tomtom_isochrones($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) result = plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) return result -$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; +$$ LANGUAGE plpythonu STABLE PARALLEL RESTRICTED; DO $$ BEGIN IF NOT EXISTS ( diff --git a/server/extension/old_versions/cdb_dataservices_server--0.4.0--0.5.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.4.0--0.5.0.sql index 57699ff..fedc7df 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.4.0--0.5.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.4.0--0.5.0.sql @@ -56,7 +56,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Mapzen routing integration @@ -86,7 +86,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, username, orgname, mapzen_app_key) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_route_point_to_point( username TEXT, @@ -135,7 +135,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ plpy.error(error_msg) finally: quota_service.increment_total_geocoder_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, diff --git a/server/extension/old_versions/cdb_dataservices_server--0.4.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.4.0.sql index 7a22e95..5aa3aac 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.4.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.4.0.sql @@ -57,7 +57,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the Redis configuration from the _conf table -- CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -82,7 +82,7 @@ RETURNS boolean AS $$ # --for this user session but... GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the Redis configuration from the _conf table -- CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) @@ -108,7 +108,7 @@ RETURNS boolean AS $$ # --for this user session but... GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -857,7 +857,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.error(error_msg) finally: quota_service.increment_total_geocoder_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username)) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.5.0--0.4.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.5.0--0.4.0.sql index dfd75be..17d9203 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.5.0--0.4.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.5.0--0.4.0.sql @@ -51,7 +51,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Mapzen integration diff --git a/server/extension/old_versions/cdb_dataservices_server--0.5.0--0.5.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.5.0--0.5.1.sql index 36f184a..5990add 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.5.0--0.5.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.5.0--0.5.1.sql @@ -20,7 +20,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -34,7 +34,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the Redis configuration from the _conf table -- CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) @@ -49,7 +49,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -63,7 +63,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -77,7 +77,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -548,7 +548,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_route_point_to_point( username TEXT, @@ -597,4 +597,4 @@ RETURNS cdb_dataservices_server.simple_route AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.5.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.5.0.sql index 1ce6c73..ccbc582 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.5.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.5.0.sql @@ -55,7 +55,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ plpy.error(error_msg) finally: quota_service.increment_total_geocoder_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -135,7 +135,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the Redis configuration from the _conf table -- CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -160,7 +160,7 @@ RETURNS boolean AS $$ # --for this user session but... GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the Redis configuration from the _conf table -- CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) @@ -186,7 +186,7 @@ RETURNS boolean AS $$ # --for this user session but... GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the Redis configuration from the _conf table -- CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) @@ -210,7 +210,7 @@ RETURNS boolean AS $$ # --for this user session but... GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -959,7 +959,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.error(error_msg) finally: quota_service.increment_total_geocoder_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username)) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.5.1--0.5.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.5.1--0.5.0.sql index fb1e61c..b869df7 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.5.1--0.5.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.5.1--0.5.0.sql @@ -63,7 +63,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the Redis configuration from the _conf table -- CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_geocoder_config(username text, orgname text) @@ -89,7 +89,7 @@ RETURNS boolean AS $$ # --for this user session but... GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the Redis configuration from the _conf table -- CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) @@ -115,7 +115,7 @@ RETURNS boolean AS $$ # --for this user session but... GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the Redis configuration from the _conf table -- CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) @@ -139,7 +139,7 @@ RETURNS boolean AS $$ # --for this user session but... GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_here_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -599,7 +599,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.error(error_msg) finally: quota_service.increment_total_geocoder_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_route_point_to_point( username TEXT, @@ -648,4 +648,4 @@ RETURNS cdb_dataservices_server.simple_route AS $$ plpy.error(error_msg) finally: quota_service.increment_total_geocoder_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.5.1--0.5.2.sql b/server/extension/old_versions/cdb_dataservices_server--0.5.1--0.5.2.sql index b5b8026..07f413e 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.5.1--0.5.2.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.5.1--0.5.2.sql @@ -58,4 +58,4 @@ RETURNS cdb_dataservices_server.simple_route AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.5.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.5.1.sql index 8dddb3c..04f4b16 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.5.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.5.1.sql @@ -55,7 +55,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -91,7 +91,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the Redis configuration from the _conf table -- CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -105,7 +105,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the Redis configuration from the _conf table -- CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) @@ -120,7 +120,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the Redis configuration from the _conf table -- CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) @@ -135,7 +135,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the Redis configuration from the _conf table -- CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) @@ -150,7 +150,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -910,7 +910,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username)) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.5.2--0.5.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.5.2--0.5.1.sql index 2378f9f..1a93f61 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.5.2--0.5.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.5.2--0.5.1.sql @@ -48,4 +48,4 @@ RETURNS cdb_dataservices_server.simple_route AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; \ No newline at end of file +$$ LANGUAGE plpythonu SECURITY DEFINER; \ No newline at end of file diff --git a/server/extension/old_versions/cdb_dataservices_server--0.5.2--0.6.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.5.2--0.6.0.sql index 4eef276..b9c26fe 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.5.2--0.6.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.5.2--0.6.0.sql @@ -20,7 +20,7 @@ RETURNS Geometry AS $$ else: plpy.error('Requested geocoder is not available') -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -51,4 +51,4 @@ RETURNS Geometry AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; \ No newline at end of file +$$ LANGUAGE plpythonu; \ No newline at end of file diff --git a/server/extension/old_versions/cdb_dataservices_server--0.5.2.sql b/server/extension/old_versions/cdb_dataservices_server--0.5.2.sql index 8d284cc..1c621bf 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.5.2.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.5.2.sql @@ -59,7 +59,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -95,7 +95,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the Redis configuration from the _conf table -- CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -109,7 +109,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the Redis configuration from the _conf table -- CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) @@ -124,7 +124,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the Redis configuration from the _conf table -- CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) @@ -139,7 +139,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the Redis configuration from the _conf table -- CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) @@ -154,7 +154,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -914,7 +914,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username)) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.6.0--0.5.2.sql b/server/extension/old_versions/cdb_dataservices_server--0.6.0--0.5.2.sql index ab2e288..911fc76 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.6.0--0.5.2.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.6.0--0.5.2.sql @@ -19,4 +19,4 @@ RETURNS Geometry AS $$ else: plpy.error('Requested geocoder is not available') -$$ LANGUAGE @@plpythonu@@; \ No newline at end of file +$$ LANGUAGE plpythonu; \ No newline at end of file diff --git a/server/extension/old_versions/cdb_dataservices_server--0.6.0--0.6.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.6.0--0.6.1.sql index b25bac3..7f3b5c2 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.6.0--0.6.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.6.0--0.6.1.sql @@ -36,4 +36,4 @@ RETURNS Geometry AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; \ No newline at end of file +$$ LANGUAGE plpythonu; \ No newline at end of file diff --git a/server/extension/old_versions/cdb_dataservices_server--0.6.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.6.0.sql index b10f05c..d70af80 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.6.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.6.0.sql @@ -65,7 +65,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -101,7 +101,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the Redis configuration from the _conf table -- CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -115,7 +115,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the Redis configuration from the _conf table -- CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) @@ -130,7 +130,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the Redis configuration from the _conf table -- CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) @@ -145,7 +145,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the Redis configuration from the _conf table -- CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) @@ -160,7 +160,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -954,7 +954,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username)) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.6.1--0.6.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.6.1--0.6.0.sql index bbbfbe4..5ac3380 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.6.1--0.6.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.6.1--0.6.0.sql @@ -30,4 +30,4 @@ RETURNS Geometry AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; \ No newline at end of file +$$ LANGUAGE plpythonu; \ No newline at end of file diff --git a/server/extension/old_versions/cdb_dataservices_server--0.6.1--0.6.2.sql b/server/extension/old_versions/cdb_dataservices_server--0.6.1--0.6.2.sql index d37789e..b749c0a 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.6.1--0.6.2.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.6.1--0.6.2.sql @@ -99,4 +99,4 @@ RETURNS cdb_dataservices_server.simple_route AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; \ No newline at end of file +$$ LANGUAGE plpythonu SECURITY DEFINER; \ No newline at end of file diff --git a/server/extension/old_versions/cdb_dataservices_server--0.6.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.6.1.sql index 7b52f71..bd8d743 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.6.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.6.1.sql @@ -67,7 +67,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -103,7 +103,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the Redis configuration from the _conf table -- CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -117,7 +117,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the Redis configuration from the _conf table -- CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) @@ -132,7 +132,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the Redis configuration from the _conf table -- CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) @@ -147,7 +147,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the Redis configuration from the _conf table -- CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) @@ -162,7 +162,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -961,7 +961,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username)) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.6.2--0.6.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.6.2--0.6.1.sql index 4d27628..f09abda 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.6.2--0.6.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.6.2--0.6.1.sql @@ -95,4 +95,4 @@ RETURNS cdb_dataservices_server.simple_route AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; \ No newline at end of file +$$ LANGUAGE plpythonu SECURITY DEFINER; \ No newline at end of file diff --git a/server/extension/old_versions/cdb_dataservices_server--0.6.2--0.7.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.6.2--0.7.0.sql index 09ec3a9..7edf6f4 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.6.2--0.7.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.6.2--0.7.0.sql @@ -13,7 +13,7 @@ RETURNS boolean AS $$ data_observatory_config = DataObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = data_observatory_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.obs_get_demographic_snapshot( username TEXT, diff --git a/server/extension/old_versions/cdb_dataservices_server--0.6.2.sql b/server/extension/old_versions/cdb_dataservices_server--0.6.2.sql index 27c47e5..506c69d 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.6.2.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.6.2.sql @@ -67,7 +67,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -103,7 +103,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the Redis configuration from the _conf table -- CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -117,7 +117,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the Redis configuration from the _conf table -- CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) @@ -132,7 +132,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the Redis configuration from the _conf table -- CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) @@ -147,7 +147,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Get the Redis configuration from the _conf table -- CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) @@ -162,7 +162,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -964,7 +964,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username)) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.7.0--0.7.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.7.0--0.7.1.sql index 05542d0..0c4a66d 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.7.0--0.7.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.7.0--0.7.1.sql @@ -14,7 +14,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.obs_get_demographic_snapshot( username TEXT, diff --git a/server/extension/old_versions/cdb_dataservices_server--0.7.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.7.0.sql index ffe6f85..31a4230 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.7.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.7.0.sql @@ -67,7 +67,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -103,7 +103,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.obs_get_demographic_snapshot( username TEXT, orgname TEXT, @@ -191,7 +191,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -205,7 +205,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -219,7 +219,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -233,7 +233,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_data_observatory_config(username text, orgname text) RETURNS boolean AS $$ @@ -247,7 +247,7 @@ RETURNS boolean AS $$ data_observatory_config = DataObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = data_observatory_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1049,7 +1049,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username)) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.7.1--0.7.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.7.1--0.7.0.sql index cbad911..c8b04ed 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.7.1--0.7.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.7.1--0.7.0.sql @@ -14,7 +14,7 @@ RETURNS boolean AS $$ data_observatory_config = DataObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = data_observatory_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.obs_get_demographic_snapshot( username TEXT, diff --git a/server/extension/old_versions/cdb_dataservices_server--0.7.1--0.7.2.sql b/server/extension/old_versions/cdb_dataservices_server--0.7.1--0.7.2.sql index 8dd6929..bbfdbdb 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.7.1--0.7.2.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.7.1--0.7.2.sql @@ -14,7 +14,7 @@ RETURNS text AS $$ user_obs_snapshot_config = GD["user_obs_snapshot_config_{0}".format(username)] return user_obs_snapshot_config.connection_str -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.obs_get_demographic_snapshot( username TEXT, @@ -64,7 +64,7 @@ RETURNS json AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.obs_get_segment_snapshot( username TEXT, @@ -112,4 +112,4 @@ RETURNS json AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; \ No newline at end of file +$$ LANGUAGE plpythonu; \ No newline at end of file diff --git a/server/extension/old_versions/cdb_dataservices_server--0.7.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.7.1.sql index 73a7670..8c38d2b 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.7.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.7.1.sql @@ -67,7 +67,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -103,7 +103,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.obs_get_demographic_snapshot( username TEXT, orgname TEXT, @@ -191,7 +191,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -205,7 +205,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -219,7 +219,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -233,7 +233,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -247,7 +247,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1049,7 +1049,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username)) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.7.2--0.7.1.sql b/server/extension/old_versions/cdb_dataservices_server--0.7.2--0.7.1.sql index fc40cc8..a2e6c49 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.7.2--0.7.1.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.7.2--0.7.1.sql @@ -43,7 +43,7 @@ RETURNS json AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.obs_get_segment_snapshot( username TEXT, @@ -81,4 +81,4 @@ RETURNS json AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; \ No newline at end of file +$$ LANGUAGE plpythonu; \ No newline at end of file diff --git a/server/extension/old_versions/cdb_dataservices_server--0.7.2--0.7.3.sql b/server/extension/old_versions/cdb_dataservices_server--0.7.2--0.7.3.sql index 43bc887..ad86fdb 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.7.2--0.7.3.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.7.2--0.7.3.sql @@ -12,7 +12,7 @@ RETURNS text AS $$ user_obs_snapshot_config = GD["user_obs_snapshot_config_{0}".format(username)] return user_obs_snapshot_config.connection_str -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshot( username TEXT, @@ -62,7 +62,7 @@ RETURNS json AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetSegmentSnapshot( username TEXT, @@ -110,4 +110,4 @@ RETURNS json AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.7.2.sql b/server/extension/old_versions/cdb_dataservices_server--0.7.2.sql index 493f271..eb30916 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.7.2.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.7.2.sql @@ -67,7 +67,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -103,7 +103,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -231,7 +231,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -245,7 +245,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -259,7 +259,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -273,7 +273,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -287,7 +287,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1089,7 +1089,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username)) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.7.3--0.7.2.sql b/server/extension/old_versions/cdb_dataservices_server--0.7.3--0.7.2.sql index f4d316c..e3a7879 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.7.3--0.7.2.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.7.3--0.7.2.sql @@ -52,7 +52,7 @@ RETURNS json AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.obs_get_segment_snapshot( username TEXT, @@ -100,4 +100,4 @@ RETURNS json AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.7.3--0.7.4.sql b/server/extension/old_versions/cdb_dataservices_server--0.7.3--0.7.4.sql index 5b8ded5..f6e12ff 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.7.3--0.7.4.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.7.3--0.7.4.sql @@ -54,4 +54,4 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; \ No newline at end of file +$$ LANGUAGE plpythonu SECURITY DEFINER; \ No newline at end of file diff --git a/server/extension/old_versions/cdb_dataservices_server--0.7.3.sql b/server/extension/old_versions/cdb_dataservices_server--0.7.3.sql index 810d474..1f9fc97 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.7.3.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.7.3.sql @@ -67,7 +67,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -103,7 +103,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -231,7 +231,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -245,7 +245,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -259,7 +259,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -273,7 +273,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -287,7 +287,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1089,7 +1089,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username)) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.7.4--0.7.3.sql b/server/extension/old_versions/cdb_dataservices_server--0.7.4--0.7.3.sql index 303d01c..274e74e 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.7.4--0.7.3.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.7.4--0.7.3.sql @@ -53,4 +53,4 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; \ No newline at end of file +$$ LANGUAGE plpythonu SECURITY DEFINER; \ No newline at end of file diff --git a/server/extension/old_versions/cdb_dataservices_server--0.7.4--0.8.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.7.4--0.8.0.sql index 8f7d4af..718f858 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.7.4--0.8.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.7.4--0.8.0.sql @@ -16,7 +16,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetDemographicSnapshotJSON( username TEXT, diff --git a/server/extension/old_versions/cdb_dataservices_server--0.7.4.sql b/server/extension/old_versions/cdb_dataservices_server--0.7.4.sql index 8b39b32..7f7f308 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.7.4.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.7.4.sql @@ -67,7 +67,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -103,7 +103,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -231,7 +231,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -245,7 +245,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -259,7 +259,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -273,7 +273,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -287,7 +287,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1090,7 +1090,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username)) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.8.0--0.7.4.sql b/server/extension/old_versions/cdb_dataservices_server--0.8.0--0.7.4.sql index b327947..f907e15 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.8.0--0.7.4.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.8.0--0.7.4.sql @@ -97,7 +97,7 @@ RETURNS json AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION cdb_dataservices_server.obs_get_segment_snapshot( username TEXT, @@ -135,4 +135,4 @@ RETURNS json AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; \ No newline at end of file +$$ LANGUAGE plpythonu; \ No newline at end of file diff --git a/server/extension/old_versions/cdb_dataservices_server--0.8.0--0.9.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.8.0--0.9.0.sql index 1fd487c..4d8bc1a 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.8.0--0.9.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.8.0--0.9.0.sql @@ -77,7 +77,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, diff --git a/server/extension/old_versions/cdb_dataservices_server--0.8.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.8.0.sql index 7c2f2e3..fe71923 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.8.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.8.0.sql @@ -67,7 +67,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -103,7 +103,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -978,7 +978,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -992,7 +992,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1006,7 +1006,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1020,7 +1020,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1034,7 +1034,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1048,7 +1048,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1851,7 +1851,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username)) diff --git a/server/extension/old_versions/cdb_dataservices_server--0.9.0--0.10.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.9.0--0.10.0.sql index 139f5f3..cf47297 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.9.0--0.10.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.9.0--0.10.0.sql @@ -51,4 +51,4 @@ RETURNS NUMERIC AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@; +$$ LANGUAGE plpythonu; diff --git a/server/extension/old_versions/cdb_dataservices_server--0.9.0--0.8.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.9.0--0.8.0.sql index a4ad981..21e434f 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.9.0--0.8.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.9.0--0.8.0.sql @@ -64,7 +64,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, diff --git a/server/extension/old_versions/cdb_dataservices_server--0.9.0.sql b/server/extension/old_versions/cdb_dataservices_server--0.9.0.sql index e082f80..6d21b2d 100644 --- a/server/extension/old_versions/cdb_dataservices_server--0.9.0.sql +++ b/server/extension/old_versions/cdb_dataservices_server--0.9.0.sql @@ -63,7 +63,7 @@ RETURNS cdb_dataservices_server.simple_route AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_route_point_to_point( username TEXT, orgname TEXT, @@ -119,7 +119,7 @@ RETURNS boolean AS $$ 'redis_metrics_connection': redis_metrics_connection, } return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- -- Observatory connection config -- @@ -1092,7 +1092,7 @@ RETURNS boolean AS $$ geocoder_config = GeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_internal_geocoder_config(username text, orgname text) RETURNS boolean AS $$ @@ -1106,7 +1106,7 @@ RETURNS boolean AS $$ geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname) GD[cache_key] = geocoder_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_isolines_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1120,7 +1120,7 @@ RETURNS boolean AS $$ isolines_routing_config = IsolinesRoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = isolines_routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_routing_config(username text, orgname text) RETURNS boolean AS $$ @@ -1134,7 +1134,7 @@ RETURNS boolean AS $$ routing_config = RoutingConfig(redis_conn, plpy, username, orgname) GD[cache_key] = routing_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_snapshot_config(username text, orgname text) RETURNS boolean AS $$ @@ -1148,7 +1148,7 @@ RETURNS boolean AS $$ obs_snapshot_config = ObservatorySnapshotConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_snapshot_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text) RETURNS boolean AS $$ @@ -1162,7 +1162,7 @@ RETURNS boolean AS $$ obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname) GD[cache_key] = obs_config return True -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; -- Geocodes a street address given a searchtext and a state and/or country CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL) RETURNS Geometry AS $$ @@ -1965,7 +1965,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.error(error_msg) finally: quota_service.increment_total_service_use() -$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER; +$$ LANGUAGE plpythonu SECURITY DEFINER; CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_isodistance(username TEXT, orgname TEXT, source geometry(Geometry, 4326), mode TEXT, range integer[], options text[] DEFAULT array[]::text[]) RETURNS SETOF cdb_dataservices_server.isoline AS $$ plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))