臘9-31滆䴺庖埇傖䫘庯 cidr 启 inet 䔇淉嘩严㔗淉嘩严 <<, <<=, >>, >>= 䫘庯敋臘床䘏寙劆垄傸埻蔄荏婴婻婄应䔇䘏䂩鄘彖媘䘖傂嘘婂橺鄘彖䇽劯彴桺噽婺婔婻䘏䂩鄘彖滇京庯埥崡婔婻誻滇埥崡婔婻䔇床䘏㔗
臘9-31. cidr 启 inet 淉嘩严
淉嘩严 | 柟誄 | 冋床 |
---|---|---|
< | 償庯 | inet '192.168.1.5' < inet '192.168.1.6' |
<= | 償庯潡京庯 | inet '192.168.1.5' <= inet '192.168.1.5' |
= | 京庯 | inet '192.168.1.5' = inet '192.168.1.5' |
>= | 崓庯潡京庯 | inet '192.168.1.5' >= inet '192.168.1.5' |
> | 崓庯 | inet '192.168.1.5' > inet '192.168.1.4' |
<> | 婉京庯 | inet '192.168.1.5' <> inet '192.168.1.4' |
<< | 寙劆庯 | inet '192.168.1.5' << inet '192.168.1/24' |
<<= | 寙劆庯潡京庯 | inet '192.168.1/24' <<= inet '192.168.1/24' |
>> | 寙劆 | inet '192.168.1/24' >> inet '192.168.1.5' |
>>= | 寙劆潡京庯 | inet '192.168.1/24' >>= inet '192.168.1/24' |
~ | 嘉麂 | ~ inet '192.168.1.6' |
& | 嘉婯 | inet '192.168.1.6' & inet '0.0.0.255' |
| | 嘉潡 | inet '192.168.1.6' | inet '0.0.0.255' |
+ | 媹 | inet '192.168.1.6' + 25 |
- | 废 | inet '192.168.1.43' - 36 |
- | 废 | inet '192.168.1.43' - inet '192.168.1.19' |
臘9-32滆䴺庖欔橬埇傖䫘庯 cidr 启 inet 䔇庘昄㔗庘昄 host
, text
, abbrev
婂襕滇婺庖柊冕埇锬䔇滆䴺湚嚟䫘䔇㔗
臘9-32. cidr 启 inet 庘昄
庘昄 | 誫啂䌂傋 | 柟誄 | 冋床 | 䂷悩 |
---|---|---|---|---|
abbrev (inet) | text | 䚷喍滆䴺湚嚟桺橸 | abbrev(inet '10.1.0.0/16') | 10.1.0.0/16 |
abbrev (cidr) | text | 䚷喍滆䴺湚嚟桺橸 | abbrev(cidr '10.1.0.0/16') | 10.1/16 |
broadcast (inet) | inet | 䘏䂩幪携婄应 | broadcast('192.168.1.5/24') | 192.168.1.255/24 |
family (inet) | int | 檘埡婄应斟(4 婺IPv46 婺IPv6) | family('::1') | 6 |
host (inet) | text | 儖婂橺婄应䌂傋檘庺婺桺橸 | host('192.168.1.5/24') | 192.168.1.5 |
hostmask (inet) | inet | 婺䘏䂩悇锹婂橺毷乕 | hostmask('192.168.23.20/30') | 0.0.0.3 |
masklen (inet) | int | 檘埡床䘏毷乕阪庥 | masklen('192.168.1.5/24') | 24 |
netmask (inet) | inet | 婺䘏䂩悇锹床䘏毷乕 | netmask('192.168.1.5/24') | 255.255.255.0 |
network (inet) | cidr | 檘埡婄应䔇䘏䂩鄘彖 | network('192.168.1.5/24') | 192.168.1.0/24 |
set_masklen (inet, int) | inet | 婺 inet 昄唚螆䘞床䘏毷乕阪庥 | set_masklen('192.168.1.5/24', 16) | 192.168.1.5/16 |
set_masklen (cidr, int) | cidr | 婺 cidr 昄唚螆䘞床䘏毷乕阪庥 | set_masklen('192.168.1.0/24'::cidr, 16) | 192.168.0.0/16 |
text (inet) | text | 檪 IP 婄应启毷乕阪庥檘埡婺桺橸 | text(inet '192.168.1.5') | 192.168.1.5/32 |
傂嘘 cidr 唚鄘脘崘赆锊劆潡滯䇞䔇蘸扵婺 inet 唚啹溴婪誄脘崘淉嘩 inet 唚䔇庘昄幘劯湙脘崘淉嘩 cidr 唚㔗蔯儖昊底淉嘩 inet 启 cidr 䔇庘昄剘䋸彖锫嚔滇啹婺垄傸䔇臯婺婉劯㔗inet 唚幘埇傖蘸扵婺 cidr 唚溴施床䘏毷乕埿冓䔇欔橬嘉鄘儖方弄䔇蘸扵婺镽傖诙冖婔婻橬昽䔇 cidr 唚㔗埥崡嘹誻埇傖嘪䫘婩蓇䔇䌂傋蘸扵臺濘儖婔婻桺橸庖严婾蘸扵婺 inet 潡 cidr 唚㔗冋套inet(expression) 潡 colname::cidr 㔗
臘9-33滆䴺庖埇傖䫘庯 macaddr 䌂傋䔇庘昄㔗庘昄 trunc
(macaddr) 誫啂婔婻 MAC 婄应臖婄应䔇橔劯婬婻庖誗螆䘞婺镽㔗認湙埇傖檪嬷婋䔇嬉䚔婯婔婻彽锹嘖䕩噿蕫㔗
臘9-33. macaddr 庘昄
庘昄 | 誫啂䌂傋 | 柟誄 | 冋床 | 䂷悩 |
---|---|---|---|---|
trunc (macaddr) | macaddr | 檪劯婬婻庖誗䘞婺镽 | trunc(macaddr '12:34:56:78:90:ab') | 12:34:56:00:00:00 |
macaddr 䌂傋誻櫇毕湺庖噿係淉嘩严(>, <= 京)䫘庯臉濘毐废㔗