Re: macaddr 64 bit (EUI-64) datatype support - Mailing list pgsql-hackers

From Tom Lane
Subject Re: macaddr 64 bit (EUI-64) datatype support
Date
Msg-id 4922.1476275580@sss.pgh.pa.us
Whole thread Raw
In response to macaddr 64 bit (EUI-64) datatype support  (Haribabu Kommi <kommi.haribabu@gmail.com>)
Responses Re: macaddr 64 bit (EUI-64) datatype support  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
Haribabu Kommi <kommi.haribabu@gmail.com> writes:
> Here I attached a POC patch that adds the support for EUI-64 MAC address
> storage with a new datatype macaddr64. Currently this type takes only
> EUI-64 datatype, not accepts 48 bit MAC address.

Our other data types that have sizes in the names measure the sizes in
bytes (float4, int8, etc).  Should this be called macaddr8?

> As we are moving to PostgreSQL 10, so are there any plans of backward
> compatiblity breakage, so the existing macaddr datatype itself can be
> changed to support both 48 and 64 bit MAC addresses.

As others have noted, there is no likelihood that we'd take a disk-format-
compatibility-breaking patch for v10.  Even if we wanted to do that, the
above proposal would also break send/recv (binary COPY) compatibility for
macaddr.

I think that probably the best bet here is to have two types and put some
thought into making them interoperate where appropriate, as the various
sizes of int do.  It's kind of a shame that this won't look like the
approach used for inet addresses, but we're stuck.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: macaddr 64 bit (EUI-64) datatype support
Next
From: Tom Lane
Date:
Subject: Re: Add PGDLLEXPORT to PG_FUNCTION_INFO_V1