Re: A question on using CIDR datatype for both ipv6 and ipv4 address

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dhaval Shah <dhaval(dot)shah(dot)m(at)gmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: A question on using CIDR datatype for both ipv6 and ipv4 address
Date: 2011-07-28 23:58:01
Message-ID: 9134.1311897481@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Dhaval Shah <dhaval(dot)shah(dot)m(at)gmail(dot)com> writes:
> Let me know why I am not getting similar results when the RHS is an
> IPV4 in IPV6 format vs, the RHS in IPV4 format.

AFAIR, the inet/cidr types consider IPv4 to be an independent set of
values that sort in front of all IPv6 values. The notion that IPv4
might be embedded in some part of the IPv6 space is not something that
that code is aware of. If it did try to do that, you'd have
'::ffff:192.0.2.124' comparing as equal to '192.0.2.124', which would
be okay for some purposes but not all.

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Rohan Kadam 2011-07-29 09:39:11 Regarding Postgres Upgrade
Previous Message Dhaval Shah 2011-07-28 23:29:28 A question on using CIDR datatype for both ipv6 and ipv4 address