From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dhaval Shah <dhaval.shah.m@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: A question on using CIDR datatype for both ipv6 and ipv4 address
Date: Thu, 28 Jul 2011 19:58:01 -0400
Message-ID: <9134.1311897481@sss.pgh.pa.us> (raw)
In-Reply-To: <CAPGmB+DJqovfoDFnCaZ+2FSOVZDpYWJTbXPev4reKck2+2EhCg@mail.gmail.com>
References: <CAPGmB+DJqovfoDFnCaZ+2FSOVZDpYWJTbXPev4reKck2+2EhCg@mail.gmail.com>
Dhaval Shah <dhaval.shah.m@gmail.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, dhaval.shah.m@gmail.com
Subject: Re: A question on using CIDR datatype for both ipv6 and ipv4 address
In-Reply-To: <9134.1311897481@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox