pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: mr.dash.four@googlemail.com
To: pgsql-bugs@postgresql.org
Subject: BUG #7575: "between" does not work properly with inet/cidr addresses
Date: Fri, 28 Sep 2012 22:08:30 +0000
Message-ID: <E1THijW-00022e-9T@wrigleys.postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      7575
Logged by:          Mr-4
Email address:      mr.dash.four@googlemail.com
PostgreSQL version: 9.1.4
Operating system:   Linux (kernel 3.5)
Description:        

1. select '10.1.1.0/24'::inet between '10.1.1.0'::inet and
'10.1.1.255'::inet gives me FALSE.

2. select '10.1.0.0/24'::inet between '10.1.0.0'::inet and
'10.1.255.255'::inet also produces FALSE.

To my understanding, 10.1.1.0/24 covers the range 10.1.1.0-10.1.1.255, so
the first statement above should produce TRUE, not FALSE. It is similar to
"select 1 between 1 and 1" which, quite rightly, produces TRUE.

Same goes for the second statement above: 10.1.0.0/24 covers the range
10.1.0.0-10.1.0.255, which falls fully within the 10.1.0.0-10.1.255.255
(10.1.0.0/16) range.

Am I missing something obvious?





view thread (5+ messages)  latest in thread

Message-ID: <E1THijW-00022e-9T@wrigleys.postgresql.org>
Permalink:  ../E1THijW-00022e-9T@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/E1THijW-00022e-9T@wrigleys.postgresql.org

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: mr.dash.four@googlemail.com
  Subject: Re: BUG #7575: "between" does not work properly with inet/cidr addresses
  In-Reply-To: <E1THijW-00022e-9T@wrigleys.postgresql.org>
  References: <E1THijW-00022e-9T@wrigleys.postgresql.org>

* 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