hostmask()

计算主机掩码的函数

hostmask() 是一个系统函数,用于计算提供 IP 地址网络的 主机掩码

hostmask() 添加于 PostgreSQL 7.4

用法

hostmask ( inet ) → inet

变更历史

示例

hostmask() 的使用示例

postgres=# SELECT hostmask('192.168.1.2/32');
 hostmask  
---------- 
 0.0.0.0   
(1 row)

postgres=# SELECT hostmask('192.168.1.2/31');
 hostmask 
----------
 0.0.0.1
(1 row)

postgres=# SELECT hostmask('192.168.1.2/16');
  hostmask   
-------------
 0.0.255.255
(1 row)

分类

网络, 系统函数

另请参阅

netmask()masklen()host()broadcast()

反馈

提交关于“hostmask()”的任何评论、建议或更正,请 在此处