↑↓ select↵ open⌫ change scopeOpen full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Unsupported versions: 7.0
Historical version. PostgreSQL 7.0 has reached end of support. See the current manual.

IP V4 Functions

Table 5-15. PostgresIP V4 Functions

FunctionReturnsDescriptionExample
broadcast(cidr)textconstruct broadcast address as textbroadcast('192.168.1.5/24')
broadcast(inet)textconstruct broadcast address as textbroadcast('192.168.1.5/24')
host(inet)textextract host address as texthost('192.168.1.5/24')
masklen(cidr)int4calculate netmask lengthmasklen('192.168.1.5/24')
masklen(inet)int4calculate netmask lengthmasklen('192.168.1.5/24')
netmask(inet)textconstruct netmask as textnetmask('192.168.1.5/24')

Report a documentation issue

Read the upstream documentation. For corrections, first check the current manual.