Jon Nelson <jnelson+pg...@jamponi.net> writes: > On Tue, Jan 31, 2012 at 2:03 PM, Robert Haas <robertmh...@gmail.com> wrote: >> What were you expecting to get? There's no such thing as a negative IP >> address.
> True, but it works for IPv4: > jnelson=# select inet '255.255.255.255' - inet '0/0'; > ?column? > ------------ > 4294967295 > (1 row) The inet minus inet operator is defined to yield bigint, so it only copes for addresses within 2^63 of each other. Short of inventing an integer type at least 129 bits wide, the only way we could fix this is to make the operator return numeric instead, which doesn't really seem like an improvement for typical use-cases. I'm fairly sure this was debated when the operator was added, and we thought it was an acceptable limitation; though maybe with IPv6 finally starting to see real usage it's going to seem less so. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs