From 6761a0309b1a611971a7138797cf38dab4618547 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Fri, 3 Oct 2008 15:37:18 +0000 Subject: Add regression test for macaddr type. Enhance documentation about accepted input formats. --- doc/src/sgml/datatype.sgml | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml index 0b969eaa22e..d05c93058a0 100644 --- a/doc/src/sgml/datatype.sgml +++ b/doc/src/sgml/datatype.sgml @@ -1,4 +1,4 @@ - + Data Types @@ -3187,23 +3187,39 @@ SELECT person.name, holidays.num_weeks FROM person, holidays - The macaddr type stores MAC addresses, i.e., Ethernet - card hardware addresses (although MAC addresses are used for - other purposes as well). Input is accepted in various customary - formats, including + The macaddr type stores MAC addresses, known for example + from Ethernet card hardware addresses (although MAC addresses are + used for other purposes as well). Input is accepted in the + following formats: + '08:00:2b:01:02:03' + '08-00-2b-01-02-03' '08002b:010203' '08002b-010203' '0800.2b01.0203' - '08-00-2b-01-02-03' - '08:00:2b:01:02:03' + '08002b010203' - which would all specify the same - address. Upper and lower case is accepted for the digits + These examples would all specify the same address. Upper and + lower case is accepted for the digits a through f. Output is always in the - last of the forms shown. + first of the forms shown. + + + + IEEE Std 802-2001 specifies the second shown form (with hyphens) + as the canonical form for MAC addresses, and specifies the first + form (with colons) as the bit-reversed notation, so that + 08-00-2b-01-02-03 = 01:00:4D:08:04:0C. This convention is widely + ignored nowadays, and it is only relevant for obsolete network + protocols (such as Token Ring). PostgreSQL makes no provisions + for bit reversal, and all accepted formats use the canonical LSB + order. + + + + The remaining four input formats are not part of any standard. -- cgit v1.2.3