字符串转64位整数:
drop function hex_to_bigint(text); CREATE FUNCTION hex_to_bigint(in_hex TEXT) RETURNS BIGINT IMMUTABLE STRICT LANGUAGE sql AS $body$ SELECT CAST(CAST(('x' || CAST($1 AS text)) AS bit(64)) AS BIGINT); $body$;
字符串转64位整数:
drop function hex_to_bigint(text); CREATE FUNCTION hex_to_bigint(in_hex TEXT) RETURNS BIGINT IMMUTABLE STRICT LANGUAGE sql AS $body$ SELECT CAST(CAST(('x' || CAST($1 AS text)) AS bit(64)) AS BIGINT); $body$;