Adds limit 1 to _geocode_ip_point

This commit is contained in:
Guido Fioravantti 2015-11-11 16:07:55 +01:00
parent 66fd33da37
commit 24c0e01b06

View File

@ -30,10 +30,13 @@ CREATE OR REPLACE FUNCTION _geocode_ip_point(ip TEXT)
RETURNS Geometry AS $$ RETURNS Geometry AS $$
DECLARE DECLARE
ret Geometry; ret Geometry;
LIM INTEGER := 1;
BEGIN BEGIN
SELECT ips.the_geom as geom INTO ret SELECT ips.the_geom as geom INTO ret
FROM public.ip_address_locations ips FROM public.ip_address_locations ips
WHERE ips.network_start_ip = ip::inet; WHERE ips.network_start_ip = ip::inet
LIMIT LIM;
RETURN ret; RETURN ret;
END END