diff --git a/server/extension/sql/60_postalcodes.sql b/server/extension/sql/60_postalcodes.sql index d7d610e..e7e8101 100644 --- a/server/extension/sql/60_postalcodes.sql +++ b/server/extension/sql/60_postalcodes.sql @@ -1,3 +1,8 @@ +CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code integer) +RETURNS Geometry AS $$ + SELECT cdb_dataservices_server.cdb_geocode_postalcode_point(username, orgname, code::text); +$$ LANGUAGE SQL; + CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code text) RETURNS Geometry AS $$ from cartodb_services.metrics import metrics @@ -34,6 +39,12 @@ RETURNS Geometry AS $$ quota_service.increment_total_service_use() $$ LANGUAGE plpythonu; + +CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code integer, country text) +RETURNS Geometry AS $$ + SELECT cdb_dataservices_server.cdb_geocode_postalcode_point(username, orgname, code::text, country) +$$ LANGUAGE SQL; + CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_point(username text, orgname text, code text, country text) RETURNS Geometry AS $$ from cartodb_services.metrics import metrics @@ -70,6 +81,12 @@ RETURNS Geometry AS $$ quota_service.increment_total_service_use() $$ LANGUAGE plpythonu; + +CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code integer) +RETURNS Geometry AS $$ + SELECT cdb_dataservices_server.cdb_geocode_postalcode_polygon(username, orgname, code::text) +$$ LANGUAGE SQL; + CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code text) RETURNS Geometry AS $$ from cartodb_services.metrics import metrics @@ -106,6 +123,12 @@ RETURNS Geometry AS $$ quota_service.increment_total_service_use() $$ LANGUAGE plpythonu; + +CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code integer, country text) +RETURNS Geometry AS $$ + SELECT cdb_dataservices_server.cdb_geocode_postalcode_polygon(username, orgname, code::text, country) +$$ LANGUAGE SQL; + CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_postalcode_polygon(username text, orgname text, code text, country text) RETURNS Geometry AS $$ from cartodb_services.metrics import metrics