Search Postgresql Archives

Q: inet operators for IPv4 encapsulated in IPv6

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 IMHO it would be logical if the second statement would also return True.  Is there any option to simply achieve this?  I use PostgreSQL v. 15 on a Debian Bookworm box.

Thanks in advance, Albrecht.

Attachment: pgpCF4WMQ8NcB.pgp
Description: PGP signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux