views:

108

answers:

2

I'm trying to find databases with support for IP addresses as a native type (as opposed to storing as a string, or an unsigned integer, which at least one commenter has already pointed out won't work for IPv6). The primary reason I'm looking for this is ease of development. For example, sorting on a "native" IP address column would be correct (as opposed to when it's stored as a string). I would assume support for such a type would also include useful operations such as determining if an IP address is inside a specified network for use in WHERE clauses.

The only one I'm aware of so far is PostgreSQL with its inet class. Does anyone have any others?

A: 

Not an answer to which engines, but if your DB doesn't support it, wrapping it in a function or defining a custom type should be pretty straight forward. I did something similar for GUIDs in Informix a while back.

hometoast
A: 

You can also define a domain : domain are made for thing like this !

Hugues Van Landeghem
Alas not every database flavour supports user-defined domains.
APC