Available in versions: Dev (3.21) | Latest (3.20) | 3.19 | 3.18 | 3.17

This documentation is for the unreleased development version of jOOQ. Click on the above version links to get this documentation for a supported version of jOOQ.

PostgreSQL CIDR type

Supported by ✅ Open Source Edition   ✅ Express Edition   ✅ Professional Edition   ✅ Enterprise Edition

The CIDR type stores an IPv4 or IPv6 network specification, such as 192.168.1.0/24. jOOQ offers support for this type via a org.jooq.postgres.extensions.types.Cidr type that exposes the data structure in form of a java.net.InetAddress and java.lang.Integer prefix.

Cidr cidr = create.fetchValue(T.CIDR, T.ID.eq(id));
InetAddress value = cidr.address();
Integer prefix = cidr.prefix();
Support for this data type is included in the jooq-postgres-extensions module.

Feedback

Do you have any feedback about this page? We'd love to hear it!

The jOOQ Logo