Skip to content

MACADDR8_SET7BIT

Set the 7th bit of a MACADDR8 value to one, also known as modified EUI-64 format, for inclusion in an IPV6 address.

MACADDR8_SET7BIT | SET7BIT (macaddr8)

where macaddr8 is a column, expression, or constant with that data type. For example:

premdb=# select macaddr8_set7bit(macaddr8 '00:34:56:ab:cd:ef') from sys.const;
   macaddr8_set7bit     
-------------------------
 02:34:56:ff:ee:ab:cd:ef
(1 row)
premdb=# select c2, macaddr8_set7bit(c2) from ipaddrs;
          c2            |    macaddr8_set7bit     
-------------------------+-------------------------
 10:20:30:aa:bb:cc:dd:ee | 12:20:30:aa:bb:cc:dd:ee
(1 row)

Parent topic:Network Address Functions