Q: inet operators for IPv4 encapsulated in IPv6 - Mailing list pgsql-general

From Albrecht Dreß
Subject Q: inet operators for IPv4 encapsulated in IPv6
Date
Msg-id SXMXUDTK.3SCF2S3E.4WL2Z437@M4LKTL7F.IEVOZHH2.TS4HJ37P
Whole thread Raw
Responses Re: Q: inet operators for IPv4 encapsulated in IPv6
List pgsql-general
I have a question regarding the use of inet operators in environments with mixed IPv4 and IPv6 notations.

Consider the example from sect. 9.12. “Network Address Functions and Operators” in the docs which returns properly

<snip>
postgres=# select '192.168.1.5'::inet << '192.168.1/24'::inet;
  ?column?
----------
  t
(1 row)
</snip>

However, for an IPv6 encapsulated IPv4 address, the result is

<snip>
postgres=# select '::ffff:192.168.1.5'::inet << '192.168.1/24'::inet;
  ?column?
----------
  f
(1 row)
</snip>

Although the representation is different, in reality '192.168.1.5' and '::ffff:192.168.1.5' designate the same node, so
IMHOit would be logical if the second statement would also return True.  Is there any option to simply achieve this?  I
usePostgreSQL v. 15 on a Debian Bookworm box. 

Thanks in advance, Albrecht.
Attachment

pgsql-general by date:

Previous
From: Erik Wienhold
Date:
Subject: Re: postgreSQL UPPER Method is converting the character "µ" into "M"
Next
From: Helmut Bender
Date:
Subject: Re: postgreSQL UPPER Method is converting the character "µ" into "M"