Re: macaddr 64 bit (EUI-64) datatype support

From: Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
To: Shay Rojansky <roji(at)roji(dot)org>
Cc: Vitaly Burovoy <vitaly(dot)burovoy(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Julien Rouhaud <julien(dot)rouhaud(at)dalibo(dot)com>, Craig Ringer <craig(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: macaddr 64 bit (EUI-64) datatype support
Date: 2016-10-25 05:38:56
Message-ID: CAJrrPGfUmY0QEatww0YSKsKQ8jeuAwDAZV_PAQi1Sz5ikcWe7w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 18, 2016 at 1:51 AM, Shay Rojansky <roji(at)roji(dot)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 Content-Type Size
mac_eui64_support_1.patch application/octet-stream 68.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2016-10-25 05:52:34 Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list
Previous Message Tom Lane 2016-10-25 04:17:37 Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list