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

From Haribabu Kommi
Subject Re: macaddr 64 bit (EUI-64) datatype support
Date
Msg-id CAJrrPGfUmY0QEatww0YSKsKQ8jeuAwDAZV_PAQi1Sz5ikcWe7w@mail.gmail.com
Whole thread Raw
In response to Re: macaddr 64 bit (EUI-64) datatype support  (Shay Rojansky <roji@roji.org>)
Responses Re: macaddr 64 bit (EUI-64) datatype support  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers


On Tue, Oct 18, 2016 at 1:51 AM, Shay Rojansky <roji@roji.org> wrote:
The current macaddr datatype needs to be kept for some time by renaming
it without changing OID and use the newer one for further usage.

From the point of view of a driver maintainer... Npgsql looks up data types by their name - upon first connection to a database it queries pg_type and maps its internal data type handlers based on name. This allows it to avoid hardcoding data type OIDs in source code, and easily handle user-defined data types as well (enums, composites...). So a sudden rename of a datatype would definitely cause a problem. Of course it's possible to first check the server version and act accordingly but it seems to complicate things needlessly.

Yes, that's correct. Changing the existing datatype name is a pain, but for enhancing
its use to adopt the new hardware addresses, i feel this is required.

Here I attached the first version of patch that supports both EUI-48 and EUI-64 type
Mac addresses with a single datatype called macaddr. This is an variable length
datatype similar like inet. It can store both 6 and 8 byte addresses. Variable length
type is used because in case in future, if MAC address gets enhanced, still this type
can support without breaking DISK compatibility.

Currently the patch lacks of documentation. Comments?

Regards,
Hari Babu
Fujitsu Australia
Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list
Next
From: Michael Paquier
Date:
Subject: Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list