Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WLerC-0006it-K7 for pgsql-bugs@arkaria.postgresql.org; Thu, 06 Mar 2014 20:25:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WLerC-0000Ll-3o for pgsql-bugs@arkaria.postgresql.org; Thu, 06 Mar 2014 20:25:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WLdbN-0002dg-5e for pgsql-bugs@postgresql.org; Thu, 06 Mar 2014 19:05:05 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WLdbK-0007rI-D1 for pgsql-bugs@postgresql.org; Thu, 06 Mar 2014 19:05:04 +0000 MIME-Version: 1.0 Subject: BUG #9455: Subtracting an IPv6 /64 network() from its broadcast() results in an out of range error To: pgsql-bugs@postgresql.org From: martin@antibodymx.net Date: Thu, 06 Mar 2014 19:04:53 +0000 Message-ID: <20140306190453.1916.4090@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.9 (-) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 9455 Logged by: Martin A. Brooks Email address: martin@antibodymx.net PostgreSQL version: 9.3.3 Operating system: Kubuntu 13.10 64 bit Description: Hello By accident I did this: ipso=# select broadcast('10.0.0.0/8') - network('10.0.0.0/8'); ?column? ---------- 16777215 (1 row) ipso=# select broadcast('2001:ba8:1f1:f12c::/64')-network('2001:ba8:1f1:f12c::/64'); ERROR: result is out of range ipso=# select broadcast('2001:ba8:1f1:f12c::/64'); broadcast ------------------------------------------ 2001:ba8:1f1:f12c:ffff:ffff:ffff:ffff/64 (1 row) ipso=# select network('2001:ba8:1f1:f12c::/64'); network ------------------------ 2001:ba8:1f1:f12c::/64 (1 row) It's arguable that broadcast doesn't make much sense for IPv6 ranges. Special casing v6 ranges for my purposes would be fine, but this result is more surprise that I expected. Regards Martin. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs