Skip to content

IPV4

The IPV4 data type stores 4-byte IP addresses in the standard format:

x.x.x.x

where x is an octet with a value between 0 and 255. An IPV4 address always contains three periods and four octets. For example:

10.10.0.1
255.255.253.0
19.120.51.251

See also IPV6, which is a separate data type, and Network Address Functions. Some network address functions accept netmask values for processing; however, only single-host specifications are stored in IPV4 columns, assuming a /32 netmask. If a source data value contains the /n CIDR notation, this notation is ignored when the value is loaded. For example, 1.2.3.4/8 is stored as 1.2.3.4

To explicitly identify a string as an IPV4 literal value, use the IPV4 keyword. For example:

where ip_address > ipv4 '192.168.1.6'

IPV4 columns do not accept empty strings.

Parent topic:SQL Data Types