From 61784c54b59ccf810f95de88ca42c60a0d7d798e Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 22 Dec 2000 18:00:24 +0000 Subject: Change default output formatting for CIDR to be unabbreviated, per recommendation from Paul Vixie. Add a new abbrev() function to produce abbreviated format as text. No forced initdb, but new function is not available unless you do an initdb or add the pg_proc row manually. --- doc/src/sgml/datatype.sgml | 24 ++++++++++++++++++------ doc/src/sgml/func.sgml | 17 ++++++++++++----- 2 files changed, 30 insertions(+), 11 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml index 6afe6cdb5a2..6286b419dc3 100644 --- a/doc/src/sgml/datatype.sgml +++ b/doc/src/sgml/datatype.sgml @@ -1,5 +1,5 @@ @@ -1818,7 +1818,7 @@ January 8 04:05:06 1999 PST class="parameter">x.x.x.x is an IP address and y is the number of bits in the netmask. If the y part is left off, then the + class="parameter">/y part is left off, then the netmask is 32, and the value represents just a single host. On display, the /y portion is suppressed if the netmask is 32. @@ -1837,7 +1837,7 @@ January 8 04:05:06 1999 PST class="parameter">x.x.x.x/y where x.x.x.x is the network and y is the number of bits in the netmask. If - y omitted, it is calculated + y is omitted, it is calculated using assumptions from the older classful numbering system, except that it will be at least large enough to include all of the octets written in the input. @@ -1848,56 +1848,68 @@ January 8 04:05:06 1999 PST <type>cidr</> Type Input Examples - + CIDR Input CIDR Displayed + abbrev(CIDR) 192.168.100.128/25 192.168.100.128/25 + 192.168.100.128/25 192.168/24 + 192.168.0.0/24 192.168.0/24 192.168/25 192.168.0.0/25 + 192.168.0.0/25 192.168.1 + 192.168.1.0/24 192.168.1/24 192.168 + 192.168.0.0/24 192.168.0/24 128.1 + 128.1.0.0/16 128.1/16 128 + 128.0.0.0/16 128.0/16 128.1.2 + 128.1.2.0/24 128.1.2/24 10.1.2 + 10.1.2.0/24 10.1.2/24 10.1 + 10.1.0.0/16 10.1/16 10 + 10.0.0.0/8 10/8 @@ -1917,8 +1929,8 @@ January 8 04:05:06 1999 PST If you do not like the output format for inet or - cidr values, try the host() and - text() functions. + cidr values, try the host(), + text(), and abbrev() functions. diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index f03fae625a2..533c1f2757d 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1,4 +1,4 @@ - + Functions and Operators @@ -2432,7 +2432,7 @@ Not defined by this name. Implements the intersection operator '#' cidr extract network part of address network('192.168.1.5/24') - 192.168.1/24 + 192.168.1.0/24 text(inet) @@ -2441,15 +2441,22 @@ Not defined by this name. Implements the intersection operator '#' text(inet '192.168.1.5') 192.168.1.5/32 + + abbrev(inet) + text + extract abbreviated display as text + abbrev(cidr '10.1.0.0/16') + 10.1/16 +
All of the functions for inet can be applied to - cidr values as well. The host() and - text() functions are primarily intended to offer - alternative display formats. + cidr values as well. The host(), + text(), and abbrev() functions are primarily + intended to offer alternative display formats. -- cgit v1.2.3