Re: macaddr 64 bit (EUI-64) datatype support
Haribabu Kommi <kommi.haribabu@gmail.com>
From: Haribabu Kommi <kommi.haribabu@gmail.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Stephen Frost <sfrost@snowman.net>,
Shay Rojansky <roji@roji.org>, Peter Eisentraut <peter.eisentraut@2ndquadrant.com>, Vitaly Burovoy <vitaly.burovoy@gmail.com>,
Alvaro Herrera <alvherre@2ndquadrant.com>, Julien Rouhaud <julien.rouhaud@dalibo.com>,
Craig Ringer <craig@2ndquadrant.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2016-11-22T04:46:32Z
Lists: pgsql-hackers
On Tue, Nov 22, 2016 at 5:33 AM, Robert Haas <robertmhaas@gmail.com> wrote: > On Sat, Nov 19, 2016 at 2:54 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote: > > Stephen Frost <sfrost@snowman.net> writes: > >> Let's create a new data type for this which supports old and new types, > >> add what casts make sense, and call it a day. Changing the data type > >> name out from under people is not helping anyone. > > > > +1. I do not think changing behavior for the existing type name is > > going to be a net win. If we'd been smart enough to make the type > > varlena from the get-go, maybe we could get away with it, but there > > is just way too much risk of trouble with a change in a fixed-length > > type's on-the-wire representation. > > I completely agree. OK. Agreed. Any suggestions for the name to be used for the new datatype the can work for both 48 and 64 bit MAC addresses? It is possible to represent a 48 bit MAC address as 64 bit MAC address by adding reserved bytes in the middle as follows. 01-01-01-01-01-01::macaddr => 01-01-01-FF-FE-01-01-01::newmacaddr While comparing a 48 bit MAC address with 64 bit MAC address, Ignore the two bytes if the contents in those bytes are reserved bytes. The new datatype can store directly whatever is the input is, like 48 bit or 64 bit. The same data is sent over the wire, whether the reserved bytes are present or not? Regards, Hari Babu Fujitsu Australia
Commits
-
Add support for EUI-64 MAC addresses as macaddr8
- c7a9fa399d55 10.0 landed
-
perltidy pg_dump TAP tests
- 6af8b89adba1 10.0 cited