type

CIDR

PostgreSQL CIDR represents network prefixes and rejects nonzero bits outside the network prefix. Example target: PostgreSQL 17. Run in a disposable database; examples need no existing tables.

Formal Syntax & Structure

sql syntaxsql
CIDR

Working Example

Example Snippetsql
SELECT CAST(CIDR '192.0.2.0/24' AS TEXT);
SQL Reference