CREATE OR REPLACE FUNCTION info.fx_ip2long(character varying)
RETURNS bigint AS
$BODY$
--
DECLARE
x bigint;
BEGIN
SELECT (((elements[1]::bigint * 256) +
elements[2]::bigint) * 256 +elements[3]::bigint) * 256 + elements[4]::bigint
INTO x FROM ( SELECT string_to_array($1, '.') as elements ) t LIMIT 1;
RETURN x;
END
--
$BODY$
LANGUAGE 'plpgsql' VOLATILE SECURITY DEFINER
COST 100;
SQL Справочник v0.05 © 2007-2025 Igor Salnikov aka SunDoctor