Changed server geocode ip address signature to match client

This commit is contained in:
Mario de Frutos
2015-11-24 10:14:34 +01:00
parent 2c7223b385
commit 8434a830b2
3 changed files with 16 additions and 16 deletions

View File

@@ -1,8 +1,8 @@
-- Interface of the server extension
CREATE OR REPLACE FUNCTION geocode_ip_point(user_id name, user_config json, geocoder_config json, ip text)
CREATE OR REPLACE FUNCTION geocode_ipaddress_point(user_id name, user_config json, geocoder_config json, ip text)
RETURNS Geometry AS $$
plpy.debug('Entering _geocode_ip_point')
plpy.debug('Entering _geocode_ipaddress_point')
plpy.debug('user_id = %s' % user_id)
#-- Access control
@@ -14,10 +14,10 @@ RETURNS Geometry AS $$
#--TODO: quota check
#-- Copied from the doc, see http://www.postgresql.org/docs/9.4/static/plpython-database.html
plan = plpy.prepare("SELECT cdb_geocoder_server._geocode_ip_point($1) AS point", ["TEXT"])
plan = plpy.prepare("SELECT cdb_geocoder_server._geocode_ipaddress_point($1) AS point", ["TEXT"])
rv = plpy.execute(plan, [ip], 1)
plpy.debug('Returning from _geocode_ip_point')
plpy.debug('Returning from _geocode_ipaddress_point')
return rv[0]["point"]
$$ LANGUAGE plpythonu;
@@ -26,7 +26,7 @@ $$ LANGUAGE plpythonu;
-- Implementation of the server extension
-- Note: these functions depend on the cdb_geocoder extension
CREATE OR REPLACE FUNCTION _geocode_ip_point(ip text)
CREATE OR REPLACE FUNCTION _geocode_ipaddress_point(ip text)
RETURNS Geometry AS $$
DECLARE
ret Geometry;