Passing mac-addresses by value?

Started by Aleksander Alekseevabout 2 months ago3 messageshackers
Jump to latest
#1Aleksander Alekseev
aleksander@timescale.com

Hi,

Mac-addresses are passed by reference. Now when Datums are always
64-bit values we can pass them by value, similarly to Timestamp[Tz].
Are there any concears in respect of change like this e.g. backward
comativility etc?

If not I would like to propose a corresponding path, probably for PG20.

--
Best regards,
Aleksander Alekseev

#2Aleksander Alekseev
aleksander@timescale.com
In reply to: Aleksander Alekseev (#1)
Re: Passing mac-addresses by value?

Mac-addresses are passed by reference. Now when Datums are always
64-bit values we can pass them by value, similarly to Timestamp[Tz].
Are there any concears in respect of change like this e.g. backward
comativility etc?

If not I would like to propose a corresponding path, probably for PG20.

Apologies for the typos. My dyslexia seems to be more pronounced today
than usual :D

--
Best regards,
Aleksander Alekseev

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Aleksander Alekseev (#1)
Re: Passing mac-addresses by value?

Aleksander Alekseev <aleksander@tigerdata.com> writes:

Mac-addresses are passed by reference. Now when Datums are always
64-bit values we can pass them by value, similarly to Timestamp[Tz].
Are there any concears in respect of change like this e.g. backward
comativility etc?

To pass standard macaddr (6 bytes) by value, we would have to add
tuple pack/unpack code paths to the existing ones for 1/2/4/8 bytes.
I can't see that that's justified. We could convert macaddr8 to be
pass-by-value without such global effects, but it looks like it
would still require wholesale changes to the macaddr8-processing
functions. On the whole I'm doubtful that there's enough gain there
to be worth the work.

regards, tom lane