Skip to content

Instantly share code, notes, and snippets.

@alexmnv
Created July 10, 2015 08:15
Show Gist options
  • Save alexmnv/6d79c990367796c76e81 to your computer and use it in GitHub Desktop.
Save alexmnv/6d79c990367796c76e81 to your computer and use it in GitHub Desktop.
Postgresql, cast inet to bigint (ip to integer)
SELECT (ip - '0.0.0.0'::inet) as ip_integer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment